from collections import Counter A = list(map(int,input().split())) d = Counter(A) three = 0 two = 0 for k in d: if d[k] == 3: three += 1 elif d[k] == 2: two += 1 if three: if two: print("FULL HOUSE") else: print("THREE CARD") else: if two == 2: print("TWO PAIR") elif two == 1: print("ONE PAIR") else: print("NO HAND")