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