#include<stdio.h>
int main(void)
{
	int x,y,i,max,j;
	int s1[6],s2[6];
	char omise[5]={'A','B','C','D','E'};
	max=-1;
	j=0;
	scanf("%d %d",&s1[0],&s2[0]);
	if(s1[0]==0 && s2[0]==0){}
	else{
		for(i=1;i<5;i++){
				scanf("%d %d",&s1[i],&s2[i]);
			}
		while(!(s1[0]==0 && s2[0]==0)){
			
			for(i=0;i<5;i++){
				x=s1[i]+s2[i];
				if(max<x){
					max=x;
					if(i>0){
						j++;
					}
				}
			}
			printf("%c %d\n",omise[j],max);
			j=0;
			for(i=0;i<5;i++){
				s1[i]=0;
				s2[i]=0;
			}
			scanf("%d %d",&s1[0],&s2[0]);
			if(s1[0]==0&& s2[0]==0){
				break;
			}
			for(i=1;i<5;i++){
				scanf("%d %d",&s1[i],&s2[i]);
			}
		}
	}
	return 0;
}