for(b="";r=readline();b+=r+"\n")for(;a=b,a!=(b=b.replace(new RegExp("(\\w)((.|\\s){"+r.length+"})\\|"),'|$2$1')););print(b)