A = list(map(int, input().split())) st = set(A) if len(st) == 2: if 2 <= A.count(A[0]) <= 3: print("FULL HOUSE") exit() elif len(st) == 3: if max([A.count(A[i]) for i in range(5)]) == 3: print("THREE CARD") else: print("TWO PAIR") exit() elif len(st) == 4: print("ONE PAIR") exit() print("NO HAND")