#!/usr/bin/ruby a=gets.split.map(&:to_i).group_by{|e|e}.map{|k,v|v.size}.sort if a==[2,3] puts 'FULL HOUSE' elsif a==[1,1,3] puts 'THREE CARD' elsif a==[1,2,2] puts 'TWO PAIR' elsif a==[1,1,1,2] puts 'ONE PAIR' else puts 'NO HAND' end