A = list(sorted(map(int, input().split()))) if list(sorted([A.count(A[0]), A.count(A[-1])])) == [2, 3]: print("FULL HOUSE") elif A.count(A[2]) == 3: print("THREE CARD") elif len(set(A)) == 3 and max(A.count(A[0]), A.count(A[-1])): print("TWO PAIR") elif len(set(A)) == 4: print("ONE PAIR") else: print("NO HAND")