using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Text; using System.Text.RegularExpressions; using System.Linq; class Magatro { static void Main() { string N = Console.ReadLine(); long max = long.Parse(N); for (int i = 1; i < N.Length; i++) { for (int j = 0; j < i; j++) { char[] c = N.ToArray(); swap(ref c[i], ref c[j]); long q = long.Parse(new string(c)); max = Math.Max(max, q); } } Console.WriteLine(max); } static void swap(ref char a, ref char b) { char t = a; a = b; b = t; } }