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