(s,*a),b=open(0) for c in a:print(end='%s[%s]%s'%b.rpartition(s));s+=c