cards = map(int, input().split()) counts = [0]*13 for num in cards: counts[num] += 1 #フルハウスならスリーペアとツーペアなので、同じカードが3枚、2枚組がいくつあるかの組み合わせを数える。 three_count = 0 two_count = 0 for c in counts: if c == 3: three_count += 1 elif c == 2: two_count += 1 #それぞれの組み合わせで役を作成してみる。 if three_count==1 and two_count == 1: print("FULL HOUSE") elif three_count==1: print("THREE CARD") elif two_count==2: print("TWO PAIR") elif two_count==1: print("ONE PAIR") else: print("NO HAND")