a = gets.split.map(&:to_i) k = Array.new(13, 0) a.each do |x| k[x - 1] += 1 end c = Array.new(6, 0) k.each do |x| c[x] += 1 end if c[3] == 1 && c[2] == 1 puts "FULL HOUSE" elsif c[3] == 1 puts "THREE CARD" elsif c[2] == 2 puts "TWO PAIR" elsif c[2] == 1 puts "ONE PAIR" else puts "NO HAND" end