from collections import Counter c = Counter(map(int, input().split())) if len(c) == 2 and c.most_common()[0][1] == 3: print('FULL HOUSE') elif len(c) == 3 and c.most_common()[0][1] == 3: print('THREE CARD') elif len(c) == 3 and c.most_common()[0][1] == c.most_common()[1][1]: print('TWO PAIR') elif len(c) == 4: print('ONE PAIR') else: print('NO HAND')