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<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;

int main(){
  int a[5][3],m;

  while(1){
    cin >> a[0][0] >> a[0][1];
    if(!a[0][0] && !a[0][1])break;

    for(int i=1;i<5;i++)cin >> a[i][0] >> a[i][1];

    m = 0;
    for(int i=0;i<5;i++){
      a[i][2] = a[i][0] + a[i][1];
      m = max(m,a[i][2]);
    }

    for(int i=0;i<5;i++){
      if(a[i][2] == m)printf("%c %d\n",'A'+i,m);
    }
  }
}

C++: #include<iostream>
#include<algorithm>
using namespace std;

int main(){
	int n1, n2;
	int salesNumbers[5];
	while(cin >> n1 >> n2, n1+n2 != 0){
		int maxNum = n1+n2;
		salesNumbers[0] = n1+n2;
		for(int i = 1; i < 5; i++){
			cin >> n1 >> n2;
			salesNumbers[i] = n1+n2;
			maxNum = max(maxNum, salesNumbers[i]);
		}
		for(int i=0; i < 5; i++){
			if(maxNum == salesNumbers[i])
				cout << (char)('A'+i) << " " << maxNum << endl;
		}
	}
}

C++: #include<bits/stdc++.h>
using namespace std;

main(){
	while(true){
		int maxI=0, maxV=0;
		
		for(int i=0; i<5; ++i){
			int a,b,v;
			cin >> a >> b;
			if(a==0 &&b==0){
				return 0;
			}
			v = a+b;
			if( maxV < v ){
				maxI = i;
				maxV = v;
			}
		}
		
		printf("%c %d\n",'A'+maxI,maxV);
	}
}

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

C++: #include<iostream>

using namespace std;

struct sct
{
	char s;
	int s1;
	int s2;
};

int main()
{
	while(true)
	{
		sct info[5], max;

		for(int i = 0; i < 5; i++)
		{
			cin >> info[i].s1 >> info[i].s2;
			info[i].s = 65 + i;

			if(info[0].s1 == 0 && info[0].s2 == 0)
			{
				return false;
			}
		}

		max = info[0];

		for(int i = 1; i < 5; i++)
		{
			if(max.s1 + max.s2 < info[i].s1 + info[i].s2)
			{
				max = info[i];
			}
		}

		cout << max.s << ' ' << max.s1 + max.s2 << endl;
	}
}

C++: #include <stdio.h>

int main()
{
        int shop[5];
        int m,e;
        int i=0,top_s,max=0;


 

       while (scanf("%d %d", &m, &e) && !(m == 0 && e == 0 && i == 5)) {
                if (i > 4) {
                        printf("%c %d", top_s+'A', max);
                        i = max = 0;
                }
                i++;
                shop[i] = m+e;
                if (shop[i] > max) {
                        max = shop[i];
                        top_s = i;



                }


        }
        return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)

main(){
  int ans,t,a,b;
  while(cin>>a>>b){
    if ( a == 0 && b == 0)break;
    ans=a+b;
    t=0;
    REP(i,1,5){
      cin>>a>>b;
      if ( a+b>ans){ans=a+b;t=i;}
    }
    cout << (char)(t+'A')<<" " << ans << endl;
  }
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    vector<int> shop(5);
    int am, pm;
    while (cin >> am >> pm) {
        if (am == 0 && pm == 0) break;
        shop.clear();
        shop[0] = am + pm;
        for (int i = 1; i < 5; i++) {
            cin >> am >> pm;
            shop[i] = am + pm;
        }
        int max_sum = 0;
        char max_shop = 'A';
        for (int i = 0; i < 5; i++) {
            if (max_sum < shop[i]) {
                max_sum = shop[i];
                max_shop = 'A' + i;
            }
        }
        cout << max_shop << ' ' << max_sum << endl;
        //cout << (char)(shop_i - shop.begin() + 'A') << *shop_i << endl;
    }
    return 0;
}

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

C++: using System;

class Program {
    static void Main() {
        char[] chars = { 'A', 'B', 'C', 'D', 'E' };

        while (true) {
            var maxNo = 0;
            var maxCount = 0;

            for (var i = 0; i < 5; i++) {
                var l = Console.ReadLine().Split(' ');
                var count = int.Parse(l[0]) + int.Parse(l[1]);

                if (count == 0)
                    return;

                if (count > maxCount) {
                    maxNo = i;
                    maxCount = count;
                }
            }

            Console.WriteLine(chars[maxNo] + " " + maxCount);
        }
    }
}

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 n[5],s1,s2,mi=0;
  while(cin>>s1>>s2,s1||s2){
    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;
}

C++: #include "bits/stdc++.h"

#define REP(i,num) for(int i=0;i<(num);++i)
#define LOOP(i) while(i--)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto pitr=c.begin();pitr!=c.end();++pitr){cout<<*pitr;if(next(pitr,1)!=c.end())cout<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);
	
	while(true){
		vector<pair<char,int>> P(5);
		P[0].first='A';
		P[0].second=in();
		P[0].second+=in();
		if(!P[0].second) break;

		P[1].first='B';
		P[1].second=in();
		P[1].second+=in();
		P[2].first='C';
		P[2].second=in();
		P[2].second+=in();
		P[3].first='D';
		P[3].second=in();
		P[3].second+=in();
		P[4].first='E';
		P[4].second=in();
		P[4].second+=in();

		sort(ALL(P),PAIRCOMP(second,>));
		out(P[0].first,P[0].second);
	}
	return 0;
}