r=raw_input;s=r();q=r();d='' for c in s:d+=c;print q.replace(d,"[%s]"%d,1)