A=list(map(int, input().split())) A.sort() two=0 three=0 for n in range(1, 14): num = A.count(n) if num == 2: two += 1 elif num == 3: three += 1 if two == 1 and three == 1: print("FULL HOUSE") elif two == 0 and three == 1: print("THREE CARD") elif two == 2 and three == 0: print("TWO PAIR") elif two == 1 and three == 0: print("ONE PAIR") else: print("NO HAND")