import sys input=lambda: sys.stdin.readline().rstrip() A=[int(i) for i in input().split()] A.sort() a,b,c,d,e=A if a==b==c==d or b==c==d==e: print("NO HAND") elif a==b==c and d==e: print("FULL HOUSE") elif a==b and c==d==e: print("FULL HOUSE") elif a==b==c or b==c==d or c==d==e: print("THREE CARD") elif a==b and c==d: print("TWO PAIR") elif a==b and d==e: print("TWO PAIR") elif b==c and d==e: print("TWO PAIR") elif a==b or b==c or c==d or d==e: print("ONE PAIR") else: print("NO HAND")