import java.util.*; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); char[] arr = sc.next().toCharArray(); for (int j = 9; j > 0; j--) { boolean hasFinish = false; int maxIdx = 0; for (int i = 0; i < arr.length; i++) { if (j == arr[i] - '0') { maxIdx = i; } } if (maxIdx == 0) { continue; } for (int i = 0; i < maxIdx; i++) { if (arr[i] - '0' < j) { char tmp = arr[i]; arr[i] = arr[maxIdx]; arr[maxIdx] = tmp; hasFinish = true; break; } } if (hasFinish) { break; } } System.out.println(arr); } }