a = list(map(int, input().split())) a.sort() dd = [] before = 0 for num in a: if before != num: dd.append(1) else: dd[-1] += 1 before = num if len(dd) == 2: if max(dd) == 3: print("FULL HOUSE") exit() elif len(dd) == 3: if max(dd) == 3: print("THREE CARD") else: print("TWO PAIR") elif len(dd) == 4: print("ONE PAIR") else: print("NO HAND")