user=list(map(int,input().split())) count1=[0,0,0,0,0] for i in range(1,6): if user[0]==i: count1[i-1]+=1 if user[1]==i: count1[i-1]+=1 if user[2]==i: count1[i-1]+=1 if user[3]==i: count1[i-1]+=1 if user[4]==i: count1[i-1]+=1 if 3 in count1: if 2 in count1: print("FULL HOUSE") else: print("THREE CARD") else: pair_count=0 for i in count1: if i==2: pair_count+=1 if pair_count==2: print("TWO PAIR") if pair_count==1: print("ONE PAIR") if pair_count==0: print("NO HAND")