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