Scanf.scanf "%s" (fun s -> let d = Array.make 10 0 in String.iter (fun c -> let q = int_of_char c - 48 in d.(q) <- d.(q) + 1) s; for i = 9 downto 0 do print_string (String.make d.(i) "0123456789".[i]) done; print_newline () )