a[999],*p=a;x,y,X,Y,v;main(c){for(;(a[40*y+x]=c=getchar())>0;x=c>15?++x:!++y)if(c==42)X|=1<<x,Y|=1<<y;for(;~Y&1;Y/=2)p+=40;for(;~X&1;X/=2)p++;for(;Y;++v,Y/=2,puts(""))for(x=0,c=X;c;c/=2)putchar(p[x+++40*v]);}
Note that non-ascii characters in the above source code will be escaped (such as \x9f).