import std.algorithm, std.array, std.container, std.range; import std.string, std.conv, std.math; import std.stdio, std.typecons; void main() { auto n = readln.chomp; auto max = n.dup; foreach (i; 0..(n.length - 1)) foreach (j; (i + 1)..n.length) { auto m = n.dup; swap(m[i], m[j]); if (m > max) max = m; } writeln(max); }