A = list(map(int, input().split())) A.sort() if A[0] == A[1]: if A[1] == A[2]: if A[3] == A[4] and A[2] != A[3]: print("FULL HOUSE") elif A[2] == A[3]: print("NO CARD") else: print("THREE CARD") elif A[2] == A[3] != A[4] or A[2] != A[3] == A[4]: print("TWO PAIR") elif A[2] == A[3] == A[4]: print("FULL HOUSE") else: print("ONE PAIR") elif A[3] == A[4]: if A[2] == A[3] and A[0] != A[1]: print("THREE CARD") elif A[1] == A[2]: print("TWO PAIR") else: print("ONE PAIR") elif A[1] == A[2] == A[3]: print("TREE CARD") elif A[1] == A[2] or A[2] == A[3]: print("ONE PAIR") else: print("NO HAND")