cards = input().split() count = [] for i in cards: count.append(cards.count(i)) if 5 in count or 4 in count: print('NO HAND') elif 3 in count: if 2 in count: print('FULL HOUSE') else: print('THREE CARD') elif 2 in count: if count.count(2) == 4: print('TWO PAIR') else: print('ONE PAIR') else: print('NO HAND')