N = list(map(int,input().split())) N.sort() three = 0 two =0 for i in range(14): if N.count(i)==3: three += 1 elif N.count(i)==2: two += 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")