/* 
 * File:   main.cpp
 * Author: freebsd
 *
 * Created on 2014/08/28, 10:07
 */

#include <cstdio>
#include <algorithm>

using namespace std;

int main() {
    while (true) {
        int s1[5] = {0}, s2[5] = {0};
        
        char store[5] = {'A', 'B', 'C', 'D', 'E'};
        
        char result = 0;
        
        for(int i = 0; i < 5; i++) {
            scanf("%d %d", &s1[i], &s2[i]);
        }
        
        for(int i = 0; i < 5; i++) {
            s1[i] += s2[i];
        }
        
        int i = 0;
        int max;
            
        max = s1[i];
        
        while(true) {           
            if(s1[i] < s1[i + 1]) max = s1[i + 1];
            if((i + 1) == 4) break;
        }
        
        result = store[i];
        
        printf("%c %d", result, max);
    }
}