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