a=gets p w=a.index $/ ?~.times{a.gsub!(/(\w)(.{#{w}})\|(.{#{w+1}})/m){'|'+$2+$1+$3}} puts a