from collections import Counter count = Counter([int(i) for i in input().split()]) a = 0 for i in count.values(): if i == 3: a += 10 elif i == 2: a += 1 if a == 11: print("FULL HOUSE") elif a == 10: print("THREE CARD") elif a == 2: print("TWO PAIR") elif a == 1: print("ONE PAIR") else: print("NO HAND")