a=System.in.text a.each{a=a.replaceAll(/^ * |(\S)(\D{50}) /,' $2$1')} print a