import collections # 入力 input = list(map(int, input().split())) # 計算 c = collections.Counter(input) list = list(c.values()) list.sort(reverse=True) if len(list) == 2: if list[0] == 3 and list[1] == 2: print("FULL HOUSE") elif len(list) == 3: if list[0] == 3: print("THREE CARD") else: print("TWO PAIR") else: if list[0] == 2: print("ONE PAIR") else: print("NO HAND")