N = input() array = list(N) for i in range(len(N)): if int(array[i]) != sorted(list(map(int, array)))[-i-1]: switch_value = sorted(list(map(int, array)))[-i-1] switch_index = list(map(int, array)).index(switch_value) temp = array[i] array[i] = switch_value array[switch_index] = temp break else: pass print(list(map(int, array)))