A=[int(n) for n in input().split()] r=[0]*13 for v in A: r[v] += 1 r=sorted(r,reverse=True) if r[0] == 3 and r[1] == 2: print("FULL HOUSE") elif r[0] == 3: print("THREE CARD") elif r[0] == 2 and r[1] == 2: print("TWO PAIR") elif r[0] == 2: print("ONE PAIR") else: print("NO HAND")