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 <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <complex>
using namespace std;
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define mp make_pair
#define ERASE(v,i) (v).erase(remove(all(v),i),(v).end())
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define each(it,c) for(typeof((c).begin()) it=(c).begin();it!=(c).end();++it)
#define debug(x) cerr<<#x<<" = "<<(x)<<endl;
#define LINE cerr<<"LINE: "<<__LINE__<<endl;
inline int toInt(string s){int v;istringstream i(s);i>>v;return v;}
template<class T> inline string toString(T x){ostringstream o;o<<x;return o.str();}
template<class T> void pv(T a,T b){for(T it=a;it!=b;++it)cerr<<*it<<" ";cerr<<endl;}
const int INF = 1000000000;
const double PI = acos(-1.0), EPS = 1e-10;

int main() {
	for(int a, m; cin >> a >> m, a || m;) {
		vector<pair<int, char> > v;
		v.push_back(mp(a + m, 'A'));
		for(int i = 1; i <= 4; i++) {
			cin >> a >> m;
			v.push_back(mp(a + m, 'A' + i));
		}
		sort(v.rbegin(), v.rend());
		cout << v[0].second << " " << v[0].first << endl;
	}

	return 0;
}

C++: //

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<cmath>

using namespace std;

#define MAX -210000000
#define MIN 210000000

int main(){
	
	int a,b,c[4],d[4],e,f;
	
	scanf("%d %d",&a,&b);
	
	while(a!=0 && b!=0){
		for(int i=1;i<5;i++) scanf("%d %d",&c[i],&d[i]);
		
		e=a+b;
		f=0;
		
		for(int i=1;i<5;i++){
			if(e<c[i]+d[i]){
				e=c[i]+d[i];
				f=i;
			}
		}
		
		if(f==0){
			printf("A %d\n",e);
		}else if(f==1){
			printf("B %d\n",e);
		}else if(f==2){
			printf("C %d\n",e);
		}else if(f==3){
			printf("D %d\n",e);
		}else if(f==4){
			printf("E %d\n",e);
		}
		scanf("%d %d",&a,&b);
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(void)
{
	char name[6]={"ABCDE"};
	int i,j,k,a,b,sum,mx,cnt;
	while(1) {
		cin>>a>>b;
		if(!a&&!b) break;
		cnt=0;
		mx=a+b;
		for(i=1;i<5;i++) {
			cin>>a>>b;
			if(mx<a+b) mx=a+b,cnt=i;
		}
		cout<<name[cnt]<<" "<<mx<<endl;
	}
}

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

int main()
{
  int s1,s2;
  for(;cin>>s1>>s2,s1||s2;)
    {
      int max=s1+s2;
      char name='A';
      for(int i=1;i<5;i++)
        {
          cin>>s1>>s2;
          if(max<s1+s2)
            {
              max=s1+s2;
              name='A'+i;
            }
        }
      cout<<name<<" "<<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++: #define _USE_MATH_DEFINES
#include <iostream>
#include <complex>
#include <algorithm>
#include <vector>
#include <stack>
#include <string>
#include <queue>
#include <cmath>
#include <math.h>
#include <numeric>
#include <list>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <climits>
#include <set>
#include <memory.h>
#include <memory>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cassert>
#include <map>
#include <cassert>
#include <time.h>
#include <ctime>

using namespace std;

typedef complex<double> xy_t;
typedef pair<xy_t, xy_t> line;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int , P> PP;
typedef pair<int, string> Ps;
typedef vector<int> vec;
typedef vector<vec> mat;
const int INF = 1 << 27;
const double EPS = 1e-9;
const double PI = 3.1415926535897932384626433832795;
const int CLK = CLOCKS_PER_SEC;

#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, m, n) for(int i = m; i < n; i++)

int main(){
	int a, b;
	while(cin >> a >> b &&  (a || b)){
		int best = a + b;
		int id = 0;
		rep2(i, 1, 5){
			cin >> a >> b;
			if(best < a + b){
				best = a + b;
				id = i;
			}
		}
		cout << (char)('A'+id) << " " << best << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <cstring>
#include <string>
#include <sstream>
#include <algorithm>
#include <iomanip>
using namespace std;

const int INF = 1 << 30;
typedef long long ll;

int main(void){
  int m[5], n[5];
  while(cin >> m[0] >> n[0] && (m[0] || n[0])){
    for(int i = 1; i < 5; i++) cin >> m[i] >> n[i];
    int maxi = 0, sn;
    for(int i = 0; i < 5; i++){
      if(m[i] + n[i] > maxi){
        maxi = m[i] + n[i];
        sn = i;
      }
    }
    cout << (char)('A' + sn) << " " << maxi << endl;
  }
  return 0;
}

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

C++: // 2011/01/13 Tazoe

#include <iostream>
using namespace std;

int main()
{
	while(true){
		int s[5][2];
		cin >> s[0][0] >> s[0][1];
		if(s[0][0]==0&&s[0][1]==0)
			break;

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

		int i_max = 0;
		int s_max = s[0][0]+s[0][1];
		for(int i=1; i<5; i++)
			if(s_max<s[i][0]+s[i][1]){
				i_max = i;
				s_max = s[i][0]+s[i][1];
			}

		cout << (char)('A'+i_max) << ' ' << s_max << endl;
	}

	return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    
    //変数：店舗 A の売上個数「s1 と s2」と置く
    int s1, s2;
    
    while(cin >> s1 >> s2){

        //条件：店舗 A の売上個数「s1 と s2」が「 0 と 0 」のとき break する
        if(s1 == 0 && s2 == 0) break;
        
        //代入：最大売上個数を「 max = s1 + s2 」と最大売上店舗「 store = 'A' 」と代入して置く
        int max = s1 + s2;
        char store = 'A';
        
        //繰返し：店舗 B ～  店舗 E の売上個数「s1 と s2」を入力するための繰返し
        for(int i = 1; i <= 4; i++){
            cin >> s1 >> s2;
            
            //条件：最大売上個数を求めるために比較する  ➡   最大個数を入れ替え  ＋   店舗に１加えBCDEへと変化させていく
            if(max < s1 + s2) max = s1 + s2, store = 'A' + i;
        }
        
        cout << store << " " << max << endl;
    }
}

C++: #include<stdio.h>

int main(void)
{
	int n[5],m[5];
	int i;
	int sum[5];
	int max;
	char bannmax,bann[5] = {'A','B','C','D','E'};
	
	while (scanf("%d %d",&n[0],&m[0])!=EOF){
	
		if(n[0] == 0 && m[0] == 0) break;

		sum[0]=n[0]+m[0];
		max=sum[0];
		bannmax='A';

		for (i=1;i<5;i++){
			scanf("%d %d",&n[i],&m[i]);
			sum[i]=n[i]+m[i];
		}

		for(i=0;i<5;i++){
			if(max < sum[i]){
			max=sum[i];
			bannmax=bann[i];
		}
	}

	printf("%c %d\n",bannmax,max);
	}
	
	return 0;
}