A = list(map(int, input().split())) D = dict() for a in A: if a not in D: D[a] = 1 else: D[a] += 1 cnt2 = 0 cnt3 = 0 for key in D: if D[key]==3: cnt3+=1 elif D[key]==2: cnt2+=1 if cnt3==1 and cnt2==1: print("FULL HOUSE") elif cnt3==1: print("THREE CARD") elif cnt2==2: print("TWO PAIR") elif cnt2==1: print("ONE PAIR") else: print("NO HAND")