using System; namespace No._39 { class Program { static void Main(string[] args) { string number = Console.ReadLine(); string result, top; int max = int.Parse(number[0].ToString()); int pos = 0; for (int i = 1; i < number.Length; i++) { if (max <= int.Parse(number[i].ToString())) { max = int.Parse(number[i].ToString()); pos = i; } } top = number[0].ToString(); result = number[pos].ToString(); for (int i = 1; i < number.Length; i++) { if (i == pos) result += number[0].ToString(); else result += number[i].ToString(); } Console.WriteLine(result); } } }