BWT by kodera

loop{a=(1..s=gets=~/$/).map{|i|($`*2)[i,s]}.sort;puts"#{a.index$`} #{a.map{|l|l[/.$/]}}"}

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

download

return top