Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var scanner = bufio.NewScanner(os.Stdin)

func main() {
HERE:
	for {
		max := 0
		shop := 'A'
		for i := 0; i < 5; i++ {
			scanner.Scan()
			buf := strings.Split(scanner.Text(), " ")
			a, _ := strconv.Atoi(buf[0])
			b, _ := strconv.Atoi(buf[1])
			if a == 0 && b == 0 {
				break HERE
			}
			if max < a+b {
				max = a + b
				shop = 'A' + int32(i)
			}
		}
		fmt.Println(string(shop), max)
	}
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

template<class T> inline T sqr(T x) {return x*x;}

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned long long ULL;

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

const double EPS = 1e-10;
const double PI  = acos(-1.0);

#define CLR(a) memset((a), 0 ,sizeof(a))

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int dx[8] = {-1, 0, 1, 0, -1, -1, 1, 1};
int dy[8] = {0, -1, 0, 1, -1, 1, -1, 1};

int main() {
  int x, y, n[5];  
  char store[5] = {'A', 'B', 'C', 'D', 'E'};

  while(cin >> x >> y, x+y != 0) {
    n[0] = x+y;
    FOR(i, 1, 5) {
      cin >> x >> y;
      n[i] = x+y;
    }

    int p, max = 0;
    REP(i, 5) {
      if(max < n[i]) {
	p = i;
	max = n[i];
      }
    }
    cout << store[p] << ' ' << max << endl;
  }
}

C++: #include<stdio.h>
#include<string.h>
int main(void)
{
	int a,b,d,i,j;
	char c[6]="ABCDE";
	scanf("%d %d",&a,&b);
	while(a!=0 || b!=0){
		j=0; d=a+b;
		for(i=1;i<5;i++){
			scanf("%d %d",&a,&b);
			if(a+b>d){
				d=a+b; j=i;
			}
		}
		printf("%c %d\n",c[j],d);
		scanf("% %d",&a,&b);
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(void){
	int a,b;
	while(1){
		int max=-1;
		char c[5];
		c[0]= 'A';
		c[1]= 'B';
		c[2]= 'C';
		c[3]= 'D';
		c[4]= 'E';
		int maxchar=0;
		
		for(int i=0;i<5;i++){
					cin >> a >> b;
			if(a == 0  && b == 0) break;
			else if(max < a+b){
				max =a+b;
				maxchar=i;
			}
		}
			if(a == 0 && b ==0) break;
		cout << c[maxchar] << " " << max <<endl;
				
	}
		
		}

C++: #include<iostream>
#include<cstdio>
#include<string>
#include<map>
using namespace std;

int main(){
  pair<int,char> shop[5];
  int am[5],pm[5];

  while(1){
    cin >> am[0] >> pm[0];
    if(am[0] == 0 && pm[0] == 0)break;

    for(int i=1;i<5;i++){
      cin >> am[i] >> pm[i];
    }
    
    for(int i=0;i<5;i++){
      shop[i].first = am[i] + pm[i];
      shop[i].second = 'A' + i;
    }
  
    sort(shop,shop+5);

    cout << shop[4].second << ' ' << shop[4].first << endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
	char output[6]={'A','B','C','D','E'};
	int a,b;
	while(cin>>a>>b&&a!=0&&b!=0){
		vector<pair<int,int> > data;
		data.push_back(make_pair(a+b,0));
		for(int i=1;i<5;i++){
			cin>>a>>b;
			data.push_back(make_pair(a+b,i));
		}
		sort(data.begin(),data.end());
		cout<<output[data[4].second]<<" "<<data[4].first<<endl;
	}
}

C++: #include<iostream>
using namespace std;
int main(void){
	int a,b;
	while(1){
		int max=-1;
		char c[5];
		c[0]= 'A';
		c[1]= 'B';
		c[2]= 'C';
		c[3]= 'D';
		c[4]= 'E';
		int maxchar=0;
		
		for(int i=0;i<5;i++){
					cin >> a >> b;
			if(a == 0  && b == 0) break;
			if(max < a+b) {
				max =a+b;
				maxchar=i;
			}
		}
		cout << c[maxchar] << " " << max << endl;
	}
}

C++: #include<iostream>
using namespace std;
int main(void){
	int a,b;
	while(1){
		int max=-1;
		char c[5];
		c[0]= 'A';
		c[1]= 'B';
		c[2]= 'C';
		c[3]= 'D';
		c[4]= 'E';
		int maxchar=0;
		
		for(int i=0;i<5;i++){
					cin >> a >> b;
			if(a == 0  && b == 0) break;
			else if(max < a+b){
				max =a+b;
				maxchar=i;
			}
		}
			if(a == 0 && b ==0) break;
		cout << c[maxchar] << " " << max <<endl;
				
	}
		
		}

C++: #include<iostream>
using namespace std;
int main()
{
	char al[6] = { "ABCDE" };
	while (true){
		int p, a, b, max = 0;
		for (int i = 0; i < 5; i++){
			cin >> a >> b;
			if (a == 0 && b == 0)return 0;
			if (max < a + b){
				max = a + b;
				p = i;
			}
		}
		cout << al[p] << " " << max << endl;
	}
}

C++: #include<stdio.h>
int main(void)
{
	int a,b,s,i,max,f,flg;
	flg=0;
	max=-1;
	while(1){
	for(i=0;i<5;i++){
		scanf("%d %d",&a,&b);
		s=a+b;
		if(a==0 && b==0){
			flg=1;
			break;
		}
		if(max<s){
			max=s;
			f=i;
		}
	}
		if(flg==1){
			break;
		}
	if(f==0){
		printf("A %d\n",max);
	}
	if(f==1){
		printf("B %d\n",max);
	}
	if(f==2){
		printf("C %d\n",max);
	}
	if(f==3){
		printf("D %d\n",max);
	}
	if(f==4){
		printf("E %d\n",max);
	}
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int max = 0;
  int max_shop = 0;
  int a,b;
  while(true){
    cin>>a>>b;
    if(!a&&!b)break;
  for(int i=0;i<5;i++){
    if(i)cin>>a>>b;
    if(a+b>max){
      max = a+b;
      max_shop = i;
    }
  }
  cout<<char(max_shop+65)<<" "<<max<<endl;
  }
  return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

typedef vector<int> vi;
typedef pair<int,int> pii;

int main(void) {
  int i,j;
  int a,b;
  while(1){
    cin>>a>>b;
    if(a==0&&b==0)break;
    int sum=a+b;
    char ans='A';
    rep(i,4){
      cin>>a>>b;
      if(sum<a+b){
        sum=a+b;
        ans='A'+i+1;
      }
    }
    cout<<ans<<" "<<sum<<endl;
  }
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#include <vector>
#include <set>

using namespace std;
typedef long long LL;
static const double EPS = 1e-9;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n) 

int main(void){  
  int s1,s2;
  while(cin>>s1>>s2,s1||s2){
    int n[5] = {0}, mi = 0;
    n[0] = s1 + s2;
    FOR(i,1,5){
      cin >> s1 >> s2;
      n[i] = s1 + s2;
    }
    FOR(i,1,5){
      if(n[mi] < n[i] ) mi = i;
    }
    printf("%c %d\n",'A'+mi,n[mi]);
  }
  return 0;
}