# your code goes here n=STDIN.gets n=n.split("") cs=[0,0,0,0,0,0,0,0,0,0] for n1 in n cs[n1.to_i]+=1 end for i in 0..9 j=9-i cs[j].times do |k| print j.to_s end end