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