lst=[0]*14 l=map(int,input().split()) for i in l: lst[i]+=1 # print(lst[1:]) two,three=0,0 for i in range(1,14): if lst[i]==2:two+=1 elif lst[i]==3:three=1 # print(two,three) tmp=(two,three) # print(tmp) ans="NO HAND" if tmp==(1,1):ans="FULL HOUSE" elif tmp==(0,1):ans="THREE CARD" elif tmp==(2,0):ans="TWO PAIR" elif tmp==(1,0):ans="ONE PAIR" print(ans)