def main(n: str): x = n.split(' ') card_list = sorted(x) print(card_list) print(type(card_list)) card_set = set(card_list) print(card_set) if len(card_set) == 5: print("NO HAND") if len(card_set) == 1: print("NO HAND") elif len(card_set) == 4: print("ONE PAIR") elif len(card_set) == 2: print("FULL HOUSE") elif card_list.count(card_list[1]) == 2: print("TWO PAIR") else: print("THREE CARD") if __name__ == "__main__": n = input() main(n)