A_lst = list(map(int, input().split())) counted_lst = [] for i in A_lst: number = A_lst.count(i) counted_lst.append(number) result = sorted(counted_lst) if result == [2, 2, 3, 3, 3]: print("FULL HOUSE") elif result == [1, 1, 3, 3, 3]: print("THREE CARD") elif result == [1, 2, 2, 2, 2]: print("TWO PAIR") elif result == [1, 1, 1, 1, 2]: print("ONE PAIR") else: print("NO HAND")