(d,*p),q=open(0) for c in p:print(end="%s[%s]%s"%q.rpartition(d));d+=c