a=input().split() d={} for i in range(5): if a[i] not in d: d[a[i]]=1 else: d[a[i]]+=1 dic2 = sorted(d.items(), key=lambda x:x[1], reverse=True) if dic2[0][1]==3 and dic2[1][1]==2: print("FULL HOUSE") elif dic2[0][1]==3: print("THREE CARD") elif dic2[0][1]==2 and dic2[1][1]==2: print("TWO PAIR") elif dic2[0][1]==2: print("ONE PAIR") else: print("NO HAND")