import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); char[] c = scanner.next().toCharArray(); for (int i = 0; i < c.length - 1; i++) { int max = -1; int index = 0; for (int j = i; j < c.length; j++) { if (max <= c[j]) { max = c[j]; index = j; } } if (c[i] < max) { char temp = c[i]; c[i] = c[index]; c[index] = temp; break; } } System.out.println(String.valueOf(c)); } }