A = list(map(int, input().split())) from collections import Counter C = Counter(A) C = list(C.items()) C.sort(key=lambda x: x[1]) if len(C) == 2: if C[0][1] == 2 and C[1][1] == 3: print('FULL HOUSE') exit() else: if len(C) == 3: if C[2][1] == 3: print('THREE CARD') exit() elif C[2][1] == 2: print('TWO PAIR') exit() else: if C[len(C)-1][1] == 2: print('ONE PAIR') exit() print('NO HAND')