from collections import Counter A = list(map(int, input().split())) c = Counter(A) mc = c.most_common() if mc[0][1]==3 and mc[1][1]==2: print("FULL HOUSE") elif mc[0][1]==3: print("THREE CARD") elif mc[0][1]==2 and mc[1][1]==2: print("TWO PAIR") elif mc[0][1]==2: print("ONE PAIR") else: print("NO HAND")