from collections import Counter cnt = Counter(map(int, input().split())) a, b = [i[1] for i in cnt.most_common(2)] if a == 3 and b == 2: print("FULL HOUSE") elif a == 3: print("THREE CARD") elif a == 2 and b == 2: print("TWO PAIR") elif a == 2: print("ONE PAIR") else: print("NO HAND")