card = input().split() card_set = set(card) if len(card_set) == 5 or len(card_set) == 1: print('NO HAND') elif len(card_set) == 4: print('ONE PAIR') elif len(card_set) == 3: mx1 = 0 for i in card_set: n = card.count(i) mx1 = max(mx1, n) if mx1 == 3: print('THREE CARD') else: print('TWO PAIR') elif len(card_set) == 2: mx2 = 0 for i in card_set: n = card.count(i) mx2 = max(mx2, n) if mx2 == 4: print('NO HAND') else: print('FULL HOUSE')