A = map(int, raw_input().split()) B = [] for i in range(1, 13+1): B.append(A.count(i)) if 3 in B: if 2 in B: print "FULL HOUSE" else: print "THREE CARD" elif 2 in B: if B.count(2) == 2: print "TWO PAIR" else: print "ONE PAIR" else: print "NO HAND"