Go: package main

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

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 {
				break HERE
			}
			if max < a + b {
				max = a + b
				shop = 'A' + int32(i)
			}
		}
		fmt.Println(string(shop), max)
	}
}

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>
#include <cstdio>
#include <string>
#include <sstream>
#include <algorithm>
#include <math.h>
#include <map>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>

#define PI 3.14159265359

#define INF 99999999;

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

typedef long long ll;

using namespace std;



/*
class LightSwitchingPuzzle
{
public:
	int minFlips(string s)
	{

	}
}
*/


int main()
{
	int s[5][3];
	char shop[5] = {'A', 'B', 'C', 'D', 'E'};
	
	while (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];
		}
		
		REP(5)
		{
			s[i][2] = s[i][0] + s[i][1];
		}
		
		int index = 0;
		int max = s[0][2];
		
		for (int i=1; i<5; i++)
		{
			if (max < s[i][2])
			{
				max = s[i][2];
				index = i;
			}
		}
		
		cout << shop[index] << " " << max << endl;
		
		/*
		//テスト出力
		REP(5)
		{
			cout << s[i][2] << " ";
		}
		cout << endl;
		*/
	}
	
	return 0;
}

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

int main() {
    vector<int> v(5);
    while (1) {
        int a, b;
        cin >> a >> b;
        if (!a && !b) break;
        v[0] = a + b;
        for (int i = 1; i < 5; i++) {
            cin >> a >> b;
            v[i] = a + b;
        }

        int ans = 0, idx;
        for (int i = 0; i < 5; i++) {
            if (ans < v[i]) ans = v[i], idx = i;
        }

        cout << (char)('A' + idx) << " " << ans << endl;
    }

    return 0;
}

C++: #include <stdio.h>
int main(){
  int  a1,a2,b1,b2,c1,c2,d1,d2,e1,e2,a,b,c,d,e,x,y,X,Y;
  char max;

    while(1){
      scanf("%d %d\n%d %d\n%d %d\n%d %d\n%d %d",&a1,&a2,&b1,&b2,&c1,&c2,&d1,&d2,&e1,&e2);
      
      if(a1==0||a2==0)break;
      
      a=a1+a2;
      b=b1+b2;
      c=c1+c2;
      d=d1+d2;
      e=e1+e2;

      if(a>b){
	x=a;
      }else if(a<b){
	x=b;
      }
      if(c>d){
	y=c;
      }else if(c<d){
	y=d;
      }
      if(x>y){
	X=x;
      }else if(x<y){
	X=y;
      }
      if(X>e){
	Y=X;
      }else if(X<e){
	Y=e;
      }

      if(Y==a){
	max='A';
      }else if(Y==b){
	max='B';
      }else if(Y==c){
	max='C';
      }else if(Y==d){
	max='D';
      }else if(Y==e){
	max='E';
      }
      
      printf("%c %d\n",max,Y);
    }
    return 0;
}

C++: #include <iostream>
using namespace std;
int s,a,b,ans;
char ch;
int main(void){
    while(1){
        ans = 0;
        for(int i=0;i<5;i++){
            cin >> a >> b;
            if(a==0 && b==0 && i==0){
                return 0;
            }
            if(a+b >= ans){
                ans = a + b;
                ch = 'A' + i;
            }
        }
        cout << ch << ' ' << ans << endl;
    }
}

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

int main(){
	int shop[5];
	char ans;int answer;
	int s1,s2;
	
	while(cin>>s1>>s2){
	
		if(s1==0&&s2==0)break;
		shop[0]=s1+s2;
		
	for(int i=1;i<5;i++){
		cin>>s1>>s2;
		shop[i]=s1+s2;
	}
	for(int i=0;i<5;i++)cout<<shop[i]<<endl;
	answer=0;
	for(int i=0;i<5;i++){
	answer=max(shop[i],answer);
	}
	if(answer==shop[0])ans='A';
	if(answer==shop[1])ans='B';
	if(answer==shop[2])ans='C';
	if(answer==shop[3])ans='D';
	if(answer==shop[4])ans='E';
	
	cout<<ans<<" "<<answer<<endl;
}
	return 0;
	
}

C++: #include<stdio.h>
int main(void)
{
	int s1[6],s2[6],s3[6],s4[6],i,j,x;
	char a[]="ABCDE";
	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++: #define _USE_MATH_DEFINES
#define INF 10000000
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>

using namespace std;

typedef long long ll;
typedef pair<int,int> P;

static const double eps = 1e-8;

int main(){
	int am,pm;
	while(~scanf("%d %d",&am,&pm)){
		if(am == pm && pm == 0) break;
		int maxV = -1;
		char alph;
		if(maxV < am+pm){
			alph = 'A';
			maxV = am+pm;
		}
		for(int i=0;i<4;i++){
			scanf("%d %d",&am,&pm);
			if(maxV < am+pm){
				alph = 'A'+i+1;
				maxV = am+pm;
			}
		}
		printf("%c %d\n",alph,maxV);
	}
}

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

int main(){
	while(1){
		int s1,s2;
		int maxc=0;
		int max=0;
		for(int i=0;i<5;i++){
			cin >> s1 >> s2;
			if(!s1&&!s2)return 0;
			if(s1+s2>max){
				max = s1 + s2;
				maxc = 'A'+i;
			}
		}
		cout << (char)maxc << " " << max << endl;
	}
}

C++: //include----------------------------------------------------------------------------------------------------------------------
#include <bits/stdc++.h>

//using namespace--------------------------------------------------------------------------------------------------------------
using namespace std;

//define-----------------------------------------------------------------------------------------------------------------------
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define INF 1 << 25
#define CLR(a) memset((a), 0 ,sizeof(a))
#define dump(x) cerr << #x << " = " << (x) << "\n";
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)

//typedef----------------------------------------------------------------------------------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned int uint;
typedef unsigned long long ull;

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

//global-----------------------------------------------------------------------------------------------------------------------
int a, b;
short c = 0;

//function---------------------------------------------------------------------------------------------------------------------
int main() {
	while ( scanf( "%d %d", &a, &b ) ) {
		if ( a == 0 && b == 0 ) {
			return 0;
		}
		int mx = a + b;
		FOR( i, 1, 5 ) {
			scanf( "%d %d", &a, &b );
			if ( mx < a + b ) {
				mx = a + b;
				c = i;
			}
		}
		printf( "%c %d\n", c + 'A', mx );
	}
	return 0;
}