A = list(map(int, input().split())) A = sorted(A) rec = [0] * 14 for a in A: rec[a] += 1 three, two = 0, 0 for i in range(14): if rec[i] == 2: two += 1 elif rec[i] == 3: three += 1 if three == 1 and two == 1: print("FULL HOUSE") elif three == 1: print("THREE CARD") elif two == 2: print("TWO PAIR") elif two == 1: print("ONE PAIR") else: print("NO HAND")