def main(n: str): x = n.split(' ') card_list = sorted(x) card_set = set(card_list) 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: if card_list.count(card_list[2]) == 3: print("FULL HOUSE") else: print("NO HAND") elif card_list.count(card_list[1]) == 2: print("TWO PAIR") else: print("THREE CARD") if __name__ == "__main__": n = input() main(n)