import collections A = sorted([int(i) for i in input().strip().split(' ')]) c = collections.Counter(A) if len(c) == 2: if [i for i in c.values()][0] == 2: print('FULL HOUSE') exit(0) elif len(c) == 3: if [i for i in c.values()][0] == 3: print('THREE CARD') exit(0) else: print('TWO PAIR') exit(0) elif len(c) == 4: print('ONE PAIR') exit(0) print('NO HAND')