c_list = list(map(int, input().split())) res_list = [] for c in c_list: res_list.append(c_list.count(c)) while True: try: if res_list.count(3) == 3 and res_list.count(2) == 2: print('FULL HOUSE') break except ValueError: pass try: if res_list.count(3) == 3: print('THREE CARD') break except ValueError: pass try: if res_list.count(2) == 4: print('TWO PAIR') break except ValueError: pass try: if res_list.count(2) == 2: print('ONE PAIR') break except ValueError: pass print('NO HAND') break