def main(): A = list(map(int, input().split())) st = set(A) C = [0] * 14 for ai in A: C[ai] += 1 cond1 = False cond2 = False pair_count = 0 for ci in C: if ci == 3: cond1 = True elif ci == 2: cond2 = True pair_count += 1 if cond1 and cond2: print('FULL HOUSE') elif cond1: print('THREE CARD') elif pair_count == 2: print('TWO PAIR') elif pair_count == 1: print('ONE PAIR') else: print('NO HAND') if __name__ == "__main__": main()