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) {swap(ar,i,j); break loop;} } } for (int i=0; i