a[30],i;main(j){for(;~scanf("%d",&j);i>1?*a-=i>2?i>3?9:11:-20:0)i=++a[i];puts("NO HAND*THREE CARDONE PAIRFULL HOUSETWO PAIR"+*a);}