import std.stdio, std.algorithm, std.conv, std.array, std.string; void main() { auto line = readln().strip(); auto s = line.to!(char[]); for (int i = 0; i < line.length - 1; ++i) { int max = line[i]; ulong pos = i; for (ulong j = line.length - 1; j > i; --j) { if (max < line[j]) { max = line[j]; pos = j; } } if (pos != i) { auto tmp = s[pos]; s[pos] = s[i]; s[i] = tmp; break; } } writeln(s); }