r='' while 1:s=raw_input(r)+'@';r='';i=1;exec"for c in s:q=c>s;i-=1|-q;r+=c[:i==q]or' '\nr=r.strip()+'\\n'\n"*9