#include<cstdio>
#include<cstring>
#include<algorithm>
#include<functional>
#include<vector>
#include<stack>
#include<queue>
#include<iostream>
using namespace std;
int main(void)
{
	int sum=0,mx=-1,ss,s,pl,flg=0;
	char pp[5]={'A','B','C','D','E'};
	while(1) {
		for(int i=0;i<5;i++) {
			sum=0;
			cin>>s>>ss;
			if(s==0 && ss==0) {flg=1;break;}
			sum=s+ss;
			if(mx<sum) {mx=sum;pl=i;}
		}
		if(flg==1)break;
		cout<<pp[pl]<<" "<<mx<<endl;
	}
}
	