a = list(map(int,input().split())) ls = [0] * 13 for i in a: ls[i-1] += 1 if 3 in ls: if 2 in ls: print("FULL HOUSE") else: print("THREE CARD") elif l.count(2) == 2: print("TWO PAIR") elif l.count(2) == 1: print("ONE PAIR") else: print("NO HAND")