nums = input().split() dict={} for i in nums: if i in dict: dict[i]+=1 else: dict[i]=1 ans=[] for key,value in dict.items(): ans.append(value) if ans.count(3)==1 and ans.count(2)==1: print("FULL HOUSE") elif ans.count(3)==1: print("THREE CARD") elif ans.count(2)==2: print("TWO PAIR") elif ans.count(2)==1: print("ONE PAIR") else: print("NO HAND")