import collections as col A = [int(i) for i in input().split()] # A = [1,1,2,2,3] B = col.Counter(A) BB = list(B.values()) if 3 in BB and 2 in BB: print("FULL HOUSE") elif 3 in BB: print("THREE CARD") elif 2 in BB: C = col.Counter(BB) if 2 in C.values(): print("TWO PAIR") else: print("ONE PAIR") else: print("NO HAND")