from collections import Counter hand = Counter([int(i) for i in input().split()]) hand_v = sorted(list(hand.values())) hand_v.reverse() if hand_v[0] == 3: if hand_v[1] == 2: print('FULL HOUSE') else: print('THREE CARD') elif hand_v[0] == 2: if hand_v[1] == 2: print('TWO PAIR') else: print('ONE PAIR') else: print('NO HAND')