N = [int(x) for x in input()] def f(): global N for i in range(len(N)-1): s = N[i] tmp = max(N[i+1:]) if tmp>s: for j in range(len(N)-1,i,-1): if N[j]==tmp:N[i]=N[j];N[j]=s;return f() print(''.join(map(str,N)))