import collections arrN = input().split(" ") c = collections.Counter(arrN) v = c.values() three = 0 two = 0 for i in v: if i == 3: three += 1 elif i == 2: two += 1 if (three == 1 and two == 1): print("FULL HOUSE") elif (three == 1 and two == 0): print("THREE CARD") elif (three == 0 and two == 2): print("TWO PAIR") elif (three == 0 and two == 1): print("ONE PAIR") else: print("NO HAND")