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 <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    for(;;){
        vector<int> a(5);
        for(int i=0; i<5; ++i){
            int b;
            cin >> a[i] >> b;
            if(a[i] == 0)
                return 0;
            a[i] += b;
        }

        int i = max_element(a.begin(), a.end()) - a.begin();
        cout << (char)(i + 'A') << ' ' << a[i] << endl;
    }
}

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

C++: //59
#include<iostream>

using namespace std;

int main(){
  for(;;){
    int ma=0;
    char shop;
    for(int i=0;i<5;i++){
      int s,ss;
      cin>>s>>ss;
      if(s==0&&ss==0)return 0;
      if(s+ss>ma){
	ma=s+ss;
	shop=i+'A';
      }
    }
    cout<<shop<<' '<<ma<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <cstdlib>

using namespace std;

int main() {
  while( 1 ) {
    int ss[ 5 ];
    int a, b;
    int maxidx = 0;
    cin >> a >> b;
    if( !a && !b ) {
      return EXIT_SUCCESS;
    }
    ss[ 0 ] = a + b;
    for( int i = 1; i < 5; i++ ) {
      cin >> a >> b;
      ss[ i ] = a + b;
      if( ss[ i ] > ss[ maxidx ] ) {
        maxidx = i;
      }
    }
    cout << ( char )( 'A' + maxidx ) << " " << ss[ maxidx ] << endl;
  }
};

C++: #include<iostream>
using namespace std;
int main(){
long s[5],a,b,i,m,mm;
while(cin>>a>>b){
if(a==0&&b==0)break;
s[0]=a+b;
for(i=1;i<5;i++){
cin>>a>>b;
s[i]=a+b;
}
for(m=s[0],mm=0,i=1;i<5;i++)if(m<s[i]){m=s[i];mm=i;}
cout<<"ABCDE"[mm]<<" "<<m<<endl;
}
return 0;
}

C++: #include <cstdio>
#define buf 10000
using namespace std;
int B[10];
void BubbleSort(void);

int main(void){
  int i,n,m,A[20001];
  char str[buf];

  for( ; ; ){
    for(i=0;i<5;i++){
      fgets(str,sizeof(str),stdin);
      sscanf(str,"%d %d",&n,&m);
      if(n==0 && m==0) return 0;
      B[i]=n+m; A[n+m]=i;
    }
    BubbleSort();
    printf("%c %d\n",'A'+A[B[0]],B[0]);
  }
  return 0;
}

void BubbleSort(void){
  int i,j,tmp;
  for(i=0;i<4;i++){
    for(j=4;j>i;j--){ 
      if(B[j] > B[j-1]){
        tmp = B[j-1];
        B[j-1] = B[j];
        B[j] = tmp;
      }
    }
  }
}

C++: #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(1){
			
			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;
}

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

using namespace std;

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

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back


int main() {
    while(1){
        int maxiNum=999999,maxi=-1;
        rep(i,5){
            int a,b;
            cin>>a>>b;
            if(i==0 && a==0 && b==0)goto end;
            
            if(a+b>maxi){
                maxiNum=i;
                maxi=a+b;
            }
            
        }
        char num[]={'A','B','C','D','E'};
        cout<<num[maxiNum]<<" "<<maxi<<endl;
    }
end:;

    return 0;
}

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

C++: #include <iostream>

using namespace std;

int main()
{
	int P, Q, R; char C;

	while (true)
	{
		R = 0;

		for (int i = 0; i < 5; i++)
		{
			cin >> P >> Q;

			if (P == 0 && Q == 0) { return 0; }

			if (R < P + Q)
			{
				R = P + Q; C = i + 65;
			}
		}

		cout << C << ' ' << R << endl;
	}
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define F first
#define S second
typedef pair<int,int> pii;
int main(){
	vector<pii> v(5);
	while(cin>>v[0].F,v[0].F){
		int t;
		cin>>t;
		v[0].F+=t;
		v[0].S=0;
		for(int i=1;i<5;i++){
			cin>>t;v[i].F=t;
			cin>>t;v[i].F+=t;
			v[i].S=i;
		}
		sort(v.begin(),v.end());
		char r='A'+v[4].S;
		cout<<r<<" "<<v[4].F<<endl;
	}
}

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

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

int main(){
	int shop[5];
	char ans;int answer;
	
	
	while(true){
		int s1,s2;
		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<bits/stdc++.h>
using namespace std;
int main() {
  int s1, s2;
  while( cin >> s1 >> s2, s1+s2 ) {
    int maxn = s1 + s1;
    int maxi;
    for(int i=1; i<5; i++) {
      cin >> s1 >> s2;
      if( maxn < s1 + s2 ) {
	maxn = s1 + s2;
	maxi = i;
      }
    }

    cout << (char)('A'+maxi) << ' ' << maxn << 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;
	
}