s[6],a[14],i;main(j){for(;~scanf("%d",&i)?++a[i]:j<14?++s[a[j++]-2]:0;);i=!puts(s[1]?*s?"FULL HOUSE":"THREE CARD":*s?*s-1?"TWO PAIR":"ONE PAIR":"NO HAND");}