lsca=list(map(int,input().split())) p2=0 p3=0 for i in range(1,14): if lsca.count(i)==2: p2+=1 if lsca.count(i)==3: p3+=1 if p3==1 and p2==1: print("FULL HOUSE") elif p3==1: print("TREE CARD") elif p2==2: print("TWO PAIR") elif p2==1: print("ONE PAIR") else: print("NO HAND")