#include <iostream>
using namespace std;

int main()
{
    int s1;
    int s2;

    while (cin >> s1 >> s2 && s1 && s2){
        int sum = s1 + s2;
        char name = 'A';
        for (int i = 0; i < 5; i++){
            cin >> s1 >> s2;
            if (s1 + s2 > sum){
                sum = s1 + s2;
                name = (char)('A' + i);
            }
        }
        cout << name << " " << sum << endl;
    }
}

