s = input()
n = len(s)
first = [n] * 26
last = [-1] * 26
for i in range(len(s)):
    c = ord(s[i]) - ord('a')
    if first[c] == n:
        first[c] = i
    last[c] = i

ans = (n, '', 0)

for c in range(26):
    i = first[c]
    for d in range(c):
        j = last[d]
        if i < j:
            ans = min(ans, (i, d, -j))

if ans[0] != n:
    i = ans[0]
    j = -ans[2]
    s = s[:i] + s[j] + s[i + 1:j] + s[i] + s[j + 1:]
print(s)
