using System; using System.Collections.Generic; using System.Linq; namespace y { class Program { static void Main(string[] args) { var a = new List

(); for (int i = 0; i < 3; i++) { string[] ss = Console.ReadLine().Split(); a.Add(new p(Convert.ToChar(('A' + i)).ToString(), int.Parse(ss[0]), int.Parse(ss[1]))); } var f = a.OrderByDescending(x => x.h).ThenBy(x => x.w); foreach (var v in f) { Console.WriteLine(v.n); } } } class p { public p(string h1, int h2, int h3) { n = h1; h = h2; w = h3; } public string n; public int h; public int w; } }