from collections import Counter hand = list(map(int, input().split())) cnt = Counter(hand) if len(cnt) == 2 and sorted(cnt.values())==[2, 3]: print('FULL HOUSE') quit() if 3 in cnt.values(): print('THREE CARD') quit() if sorted(cnt.values()) == [1, 2, 2]: print('TWO PAIR') quit() if 2 in cnt.values(): print('ONE PAIR') quit() print('NO HAND')