using System; using System.Collections.Generic; using System.Linq; class Program { static void Main() { char[] N = Console.ReadLine().ToCharArray(); int idx = Array.LastIndexOf(N, N.Max()); char w = N[0]; N[0] = N[idx]; N[idx] = w; Console.WriteLine(new string(N)); } }