def determine_role(total): if 5 == total: return ("FULL HOUSE") elif 4 == total: return ("THREE CARD") elif 3 == total: return ("TWO PAIR") elif 2 == total: return ("ONE PAIR") else: return ("NO HAND") def main(): hands = sorted(list(map(int, input().split()))) role_hands = list(set(hands)) role_counts = [hands.count(role) for role in role_hands] role_counts = [pair_card for pair_card in role_counts if pair_card != 1] total = sum(role_counts) result = determine_role(total) print(result) if __name__ == "__main__": main()