p=print s=sorted A=s(map(int,input().split())) R=s([A.count(x) for x in set(A)]) if R==[2,3]:p('FULL HOUSE') elif 3 in R:p('THREE CARD') elif R==[1,2,2]:p('TWO PAIR') elif 2 in R:p('ONE PAIR') else:p('NO HAND')