Bead Sort by clock

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

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page