A_lst = list(map(int, input().split())) counter_lst = [] for i in A_lst: counter = A_lst.count(i) counter_lst.append(counter) grouped = list(set(counter_lst)) if grouped == [2, 3]: print("FULL HOUSE") elif grouped == [1, 3]: print("THREE CARD") elif grouped == [1, 2]: print("THREE CARD") elif grouped == [1, 2]: print("ONE PAIR") else: print("NO HAND")