def main(): A = sorted(map(int, input().split())) if A[0] == A[1] and A[3] == A[4] and A[2] in [A[1], A[3]]: print('FULL HOUSE') elif A[0] == A[1] == A[2] or A[1] == A[2] == A[3] or A[2] == A[3] == A[4]: print('THREE CARD') elif (A[0] == A[1] or A[1] == A[2]) and (A[2] == A[3] or A[3] == A[4]): print('TWO PAIR') elif (A[0] == A[1] or A[1] == A[2]) or (A[2] == A[3] or A[3] == A[4]): print('ONE PAIR') else: print('NO HAND') if __name__ == '__main__': main()