from collections import Counter d = Counter(input().split()) t = sorted(d.values()) if t == [2,3]: print("FULL HOUSE") elif t == [1,1,3]: print("THREE CARD") elif t == [1,2,2]: print("TWO PAIR") elif t == [1,1,1,2]: print("ONE PAIR") else: print("NO HAND")