main(a,b){char*p,s[9];while((b=getchar())-10)a*=b;while(a-b?0:puts(s),b=1,gets(p=s))while(*p)b*=*p++;}