using System; using System.Linq; using System.Collections.Generic; public class yukicoder { public static void Main() { string[] bro = new string[]{"A", "B", "C"}; List Height = new List(); List Weight = new List(); for(int i = 0; i <= 2; i++) { int[] work = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray(); Height.Add(work[0]); Weight.Add(work[1]); } for(int j = 0; j <= bro.Length - 2; j++) { for(int i = 0; i <= bro.Length - 2; i++) { bool swap = false; if(Height[i] < Height[i + 1]) { swap = true; } else if(Height[i] == Height[i + 1] && Weight[i] > Weight[i + 1]) { swap = true; } if(swap) { string temp1 = bro[i]; bro[i] = bro[i + 1]; bro[i + 1] = temp1; int temp2 = Height[i]; Height[i] = Height[i + 1]; Height[i + 1] = temp2; int temp3 = Weight[i]; Weight[i] = Weight[i + 1]; Weight[i + 1] = temp3; } } } bro.ToList().ForEach(x => Console.WriteLine(x)); } }