using System;

class Program {
    static void Main() {
        char[] chars = { 'A', 'B', 'C', 'D', 'E' };

        while (true) {
            var maxNo = 0;
            var maxCount = 0;

            for (var i = 0; i < 5; i++) {
                var l = Console.ReadLine().Split(' ');
                var count = int.Parse(l[0]) + int.Parse(l[1]);

                if (count == 0)
                    return;

                if (count > maxCount) {
                    maxNo = i;
                    maxCount = count;
                }
            }

            Console.WriteLine(chars[maxNo] + " " + maxCount);
        }
    }
}