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