cards = input() split_cards = cards.split() int_cards = list(map(int, split_cards)) count = [] for card in split_cards: count.append(split_cards.count(card)) if 3 in count and 2 in count: print("FULL HOUSE") elif 3 in count: print("THREE CARD") elif 2 in count and count.count(2) == 4: print("TWO PAIR") elif 2 in count: print("ONE PAIR") else: print("NO HAND")