n = list(map(int,input())) temp = n[:] mx1 = max(n) a = n.index(mx1) temp[0] = mx1 temp[a] = n[0] temp2 = temp[:] mx2 = max(temp[1:]) b = temp[1:].index(mx2) temp2[1] = mx2 temp2[b+1] = temp[1] ans = list(map(str, temp2)) print("".join(ans))