import java.util.*; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { String s = sc.next(); int[] ar = new int[s.length()]; for (int i=0; i=i+1; j--) { search = Integer.parseInt(s.substring(j,j+1)); if (search > base) { max = Math.max(max,search); l = i; r = j; } } if (max > base) {swap(ar,l,r); break;} } for (int i=0; i