list=[int(i)for i in input().split()] t=0 p=0 c=0 for i in range(len(list)): c=list.count(list[i]) if c==3: t=t+1 elif c==2: p=p+1 c=0 i=i+1 if t==3 and p==2: print("FULL HOUSE") elif t==3: print("THREE CARD") elif p==4: print("TWO PAIR") elif p==2: print("ONE PAIR") else: print("NO HAND")