Ejection by yowa

d=[0]*11
u=d.dup
o=$<.map{|$_|(~/\#$/).times{|i|d[i]+=(c=$_[i])%5&1;u[i]+=c/85}
chomp.tr("RDU",' ')+gsub(/[^R]/){}}
s='D'
[d,u].map{|c|10.times{|i|c.any?{|x|x>i}&&o<<(c.map{|x|x>i ?s:' '}*"").rstrip}
s='U'
o.reverse!}
puts o

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

download

return top