using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace foryuki { class Program { static int[] n; static void Main(string[] args) { var c = Console.ReadLine().ToCharArray(); string s; int a; int max = int.Parse(s = new string(c)); char w; char[] c2 = new char[c.Length]; for (int i = 0; i < c.Length; i++) { for (int j = 0; j < c.Length; j++) { c.CopyTo(c2, 0); w = c2[i]; c2[i] = c2[j]; c2[j] = w; a = int.Parse(s = new string(c2)); if (a > max) { max = a; } } } Console.WriteLine(max); } //------------------------------------------------------------- static int[] ConvertStringArrayToIntArray(string[] array) { return Array.ConvertAll(array, str => int.Parse(str)); } static List ConvertStringArrayToIntList(string[] str) { var list = new List(); foreach (var c in str) { list.Add(int.Parse(c)); } return list; } } }