import List u=unwords m@main=getLine>>=putStrLn.u.map(\n->'[':u n++"]").group.words>>m