x=list(map(int,input().split())) sec,thi=0,0 for i in range(10): if x.count(i)==3: thi+=1 elif x.count(i)==2: sec+=1 if thi==1 and sec==1: print("FULL HOUSE") elif thi==1 and sec==0: print("THREE CARD") elif thi==0 and sec==2: print("TWO PAIR") elif thi==0 and sec==1: print("ONE PAIR") else: print("NO HAND")