s[90];main(p,i,q){gets(s);p=strchr(s,84)-(int)s;for(;gets(s),i=p;){for(;i--;)putchar(32);puts("*");q=strchr(s,75);if(q){for(i=q-(int)s;i--;)putchar(32);for(i=p-(q-(int)s)+1;i--;)putchar(42);break;}}}