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>
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=shop[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 <iostream>
#include <fstream>
#include <typeinfo>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<25;
const double pi=acos(-1);
const double eps=1e-8;
const vi emp;

int s1,s2;

int main(){
	while(1){
		cin>>s1>>s2;
		if(!s1&&!s2) break;
		P ans;
		ans=P(0,s1+s2);
		for(int i=0;i<4;i++){
			cin>>s1>>s2;
			if(ans.second<s1+s2) ans=P(i+1,s1+s2);
		}
		int T=ans.first;
		if(!T) cout<<'A'<<' ';
		else if(T==1) cout<<'B'<<' ';
		else if(T==2) cout<<'C'<<' ';
		else if(T==3) cout<<'D'<<' ';
		else cout<<'E'<<' ';
		cout<<ans.second<<endl;
	}
}

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

int main() {
	int a[5][2];
	while(cin >> a[0][0] >> a[0][1], a[0][0] || a[0][1]) {
		for(int i = 1; i < 5; i++) {
			cin >> a[i][0] >> a[i][1];
		}
		int indx, mx = 0;
		for(int i = 0; i < 5; i++) {
			if(mx < a[i][0] + a[i][1]) {
				mx = a[i][0] + a[i][1];
				indx = i;
			}
		}
		cout << (char)('A' + indx) << " " << mx << endl;
	}
}

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

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

C++: #include<stdio.h>
#include<string.h>
int main(void)
{
	int a[5],b[5],d,i,j;
	char c;
	scanf("%d %d",&a[0],&b[0]);
	while(a[i]!=0 || b[i]!=0){
		c=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]; c='A'+i;
			}
		}
		printf("%c %d\n",c,d);
		i=0;
		scanf("% %d",&a[i],&b[i]);
	}
	return 0;
}

C++: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

int a[5];
int main() {
	while (1) {
		rep(i, 5) {
			int s1, s2; cin >> s1 >> s2;
			if (s1 == 0 && s2 == 0)return 0;
			a[i] = s1 + s2;
		}
		int*ans = max_element(a, a + 5);
		cout << (char)(ans - a + 'A') << ' ' << *ans << endl;
	}
}

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

using namespace std;
typedef pair<int, int> P;
char c[5] = {'A', 'B', 'C', 'D', 'E'};

void solve()
{
	vector<int> Vec(5);
	int a, b;
	while(cin >> a >> b, a || b)
	{
		Vec[0] = a + b;
		for(int i = 1; i < 5; ++i)
		{
			cin >> a >> b;
			Vec[i] = a + b;
		}
		int max_shop = 0;
		int max_sell_num = Vec[0];
		for(int i = 0; i < 5; ++i)
		{
			if(max_sell_num < Vec[i])
			{
				max_sell_num = Vec[i];
				max_shop = i;
			}
		}
		cout << c[max_shop] << " " << Vec[max_shop] << endl;
	}
}

int main()
{
	solve();
	return(0);
}

C++: #include <bits/stdc++.h>
using namespace std;
int A[5][2];
int main(){
    while(cin >> A[0][0] >> A[0][1]){
        if(A[0][0] + A[0][1] == 0){
            return 0;
        }
        cin >> A[1][0] >> A[1][1] >> A[2][0] >> A[2][1] >> A[3][0] >> A[3][1] >> A[4][0] >> A[4][1];
        int a0 = A[0][0] + A[0][1], a1 = A[1][0] + A[1][1], a2 = A[2][0] + A[2][1], a3 = A[3][0] + A[3][1], a4 = A[4][0] + A[4][1];
        if(a0 >= a1 && a0 >= a2 && a0 >= a3 && a0 >= a4){
            cout << "A " << a0 << endl;
        }
        if(a1 >= a0 && a1 >= a2 && a1 >= a3 && a1 >= a4){
            cout << "B " << a1 << endl;
        }
        if(a2 >= a0 && a2 >= a1 && a2 >= a3 && a2 >= a4){
            cout << "C " << a2 << endl;
        }
        if(a3 >= a0 && a3 >= a1 && a3 >= a2 && a3 >= a4){
            cout << "D " << a3 << endl;
        }
        if(a4 >= a0 && a4 >= a1 && a4 >= a2 && a4 >= a3){
            cout << "E " << a4 << endl;
        }
    }
    //cout << 654231 << endl;
    return 0;
}

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

C++: #include<cstdio>
#include<cstring>
using namespace std;
int main(){
    int x,y;
    while(scanf("%d%d",&x,&y),x,y){
        int data=0;
        int q = 0;
        data = x+y;
        for(int i = 1;i <= 4; i++){
            scanf("%d%d",&x,&y);
            if(data < x+y){
                data = x+y;
                q = i;
            }
        }
        printf("%c %d\n",q+65,data);
    }
    return 0;
}

C++: #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

int main() {
	int a,b;
	int mx;
	char res;
	while(a=in(),b=in()){
		mx=a+b;
		res='A';
		int i;
		for(i=1;i<5;i++){
			a=in(),b=in();
			if(mx<a+b){
				mx=a+b;
				res='A'+i;
			}
		}
		cout<<res<<" "<<mx<<endl;
	}
	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<stdio.h>
int main(void)
{
	int a,s,d,i,max,f,flg;
	max=0;
	flg=0;
	while(1){
		for(i=1;i<=5;i++){
		scanf("%d %d",&a,&s);
		if(a==0 && s==0){
			flg=1;
			break;
		}
			d=a+s;
			if(max<d){
				max=d;
				f=i;
			}
		}
		if(flg==1){
			break;
		}                         
	if(f==1){
		printf("A %d\n",max);
	}
	if(f==2){
		printf("B %d\n",max);
	}
	if(f==3){
		printf("C %d\n",max);
	}
	if(f==4){
		printf("D %d\n",max);
	}
	if(f==5){
		printf("E %d\n",max);
	}
	}	
	return 0;
}