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