A = list(map(int, input().split())) res = [0 for _ in range(14)] for k in A: res[k] += 1 res.sort(reverse = True) if res[0] == 3: if res[1] == 2: print("FULL HOUSE") else: print("THREE CARD") elif res[0] == 2: if res[1] == 2: print("TWO PAIR") else: print("ONE PAIR") else: print("NO HAND")