data order by shinh

a=*$<
a.map{|_|p$.-a.sort_by(&:to_i).rindex(_)}

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

download

return top