using System; using System.Linq; namespace No39_1{ public class Program{ public static void Main(string[] args){ var n = Console.ReadLine().ToCharArray(); var length = n.Length; var max = n.Max(); var tmp = n[0]; for(var i = length - 1; i > 0; i--){ if(n[i] == max){ n[0] = n[i]; n[i] = tmp; break; } } Console.WriteLine(n); } } }