for(b="";r=readline();b+=r+"\n")for(i in b)b=b.replace(RegExp("(\\w)([^]{"+r.length+"})\\|"),'|$2$1');print(b)