import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import static java.lang.System.in; public class Main { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(in)); String N = reader.readLine(); int[] table = new int[10]; for (int i = 0; i < N.length(); i++) { table[Character.getNumericValue(N.charAt(i))] += 1; } StringBuilder builder = new StringBuilder(); for (int i = 9; i >= 0; i--) { int j = i; while (table[j] != 0) { builder.append(j); table[j] -= 1; } } System.out.println(builder.toString()); } }