import java.io.BufferedReader; import java.io.InputStreamReader; public class No256 { public static void main(String[] args) { try { BufferedReader br = new BufferedReader(new InputStreamReader( System.in)); char[] cArray = br.readLine().toCharArray(); int maxIdx = -1; char maxChar = '/'; for (int i = 0; i < cArray.length; i++) { if (maxChar <= cArray[i]) { maxChar = cArray[i]; maxIdx = i; } } swap(cArray, 0, maxIdx); maxIdx = -1; maxChar = '/'; for (int i = 1; i < cArray.length; i++) { if (maxChar <= cArray[i]) { maxChar = cArray[i]; maxIdx = i; } } swap(cArray, 1, maxIdx); System.out.println(cArray); } catch (Exception e) { e.printStackTrace(); System.err.println("Error:" + e.getMessage()); } } static void swap(char[] cArray, int i, int j) { char tmp = cArray[i]; cArray[i] = cArray[j]; cArray[j] = tmp; } }