n_list = input().split(" ") n_list = [int(i) for i in n_list] c_list = [0] * 13 for i in range(1,14): for j in range(5): if n_list[j] == i: print(n_list[j], i) c_list[i-1] += 1 if (3 in c_list) and (2 in c_list): print("FULL HOUSE") elif (3 in c_list): print("THREE CARD") elif c_list.count(2) == 2: print("TWO PAIR") elif 2 in c_list: print("ONE PAIR") else: print("NO HAND")