from collections import Counter A = Counter(map(int, input().split())) ans = sorted(A.values())[::-1] if ans[0] == 3: if ans[1] == 2: print("FULL HOUSE") else: print("THREE CARD") elif ans[0] == 2: if ans[1] == 2: print("TWO PAIR") else: print("ONE PAIR") else: print("NO HAND")