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