def determine_role(hand_counts): if len(hand_counts) == 2: if hand_counts[0] == 2 and hand_counts[1] == 3: return "FULL HOUSE" else: return "TWO PAIR" elif len(hand_counts) == 1: if hand_counts[0] == 3: return "THREE CARD" elif hand_counts[0] == 2: return "ONE PAIR" else: return "NO HAND" else: return "NO HAND" def main(): cards = sorted(list(map(int, input().split()))) hand = list(set(cards)) hand_counts = [cards.count(role) for role in hand] hand_counts = sorted([pair_card for pair_card in hand_counts if pair_card != 1]) result = determine_role(hand_counts) print(result) if __name__ == "__main__": main()