import textwrap as w n=input()-1 while 1:print w.fill(raw_input(),n).replace('t.\n','t. \n')