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