a = np.array(list(map(int, input().split()))) u, counts = np.unique(a, return_counts=True) if np.max(counts) == 3: if counts.shape == 2: print("FULL HOUSE") else: print("THREE CARD") elif np.max(counts) == 2: if counts.shape == 3: print("TWO PAIR") else: print("ONE PAIR") else: print("NO HAND")