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<vector>
#include<algorithm>
using namespace std;
int main() {
	enum tol { a, b, c, d, e };
	vector<tol>l;
	int a1, a2;
	while (cin >> a1 >> a2){
		if (a1 == 0 && a2 == 0)break;
		int o[5];
		int oo[5];
		a1 += a2;
		o[0] = a1;
		for (int i = 1; i < 5; i++) {
			cin >> a1 >> a2;
			a1 += a2;
			o[i] = a1;
		}
		for (int i = 0; i < 5; i++)oo[i] = o[i];
		sort(oo, oo + 5);
		if		(oo[4] == o[0])l.push_back(a);
		else if (oo[4] == o[1])l.push_back(b);
		else if (oo[4] == o[2])l.push_back(c);
		else if (oo[4] == o[3])l.push_back(d);
		else if (oo[4] == o[4])l.push_back(e);
	}
	for (tol p : l) {
		if (p == a)cout << "A";
		else if (p == b)cout << "B";
		else if (p == c)cout << "C";
		else if (p == d)cout << "D";
		else if (p == e)cout << "E";
		cout << endl;
	}
	char ch;
	cin >> ch;
}

C++: #include <iostream>
#include <algorithm>
#include <math.h>
#include <cmath>
#include <stdio.h>
#include <string>
#include <string.h>
#include <cstring>
#include <sstream>
#include <iomanip>
#include <stdlib.h>

using namespace std;

int main (void)
{
	for (int u = 0; u < 100; u++)
	{
		int a[5],b[5];
		int p = 0;

		for (int i = 0; i < 5; i++)
		{
			cin >> a[i] >> b[i];
			if (a[i] == 0)
			{
				p++;
				break;
			}
		}
		if (p != 0)
		{
			break;
		}

		int gg = 0,ggg = 0;
		for (int i = 0; i < 5; i++)
		{
			if (a[i] + b[i] > gg)
			{
				gg = 0;
				gg = a[i] + b[i];
				ggg = 0;
				ggg = i;
			}
		}


		if (ggg == 0)
		{
			cout << 'A';
		}
		else if (ggg == 1)
		{
			cout << 'B';
		}
		else if (ggg == 2)
		{
			cout << 'C';
		}
		else if (ggg == 3)
		{
			cout << 'D';
		}
		else if (ggg == 4)
		{
			cout << 'E';
		}
		cout << " " << gg << endl;
	}
}

C++: #include<stdio.h>
int main(){
	while(1){
		int max=0;char sec;
		for(int i=0;i<5;i++){
			int a,b;scanf("%d%d",&a,&b);
			if(i==0&&(a|b)==0)return 0;
			if(max<a+b){
				max=a+b;sec='A'+i;
			}
		}printf("%c %d\n",sec,max);
	}
}

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<iostream>
using namespace std;
int main()
{
  while(true){
    int maxamnt = 0;
    char ans;
    for(int i = 0; i < 5; ++i){
      int bn,an;
      cin >> bn;
      cin >> an;
      if( an + bn == 0 ) return 0;
      if( maxamnt < an+bn ){
	maxamnt = an+bn;
	ans = 'A' + i;
      }
    }
    cout << ans << ' ' << maxamnt << endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
    bool flag =true;
    while(flag){
        priority_queue<pair<int,char> > data;
        while(!data.empty())data.pop();
        for(int i='A';i <='E';i++){
            int x,y;
            cin>>x>>y;
            int sum =x+y;
            if(sum==0){
                flag =false;
                break;
            }
            data.push(make_pair(sum,i));
        }
        if(flag)
            cout <<data.top().second<<" "<<data.top().first<<endl;
    }
    return 0;
}

C++: 
#include <bits/stdc++.h>
#include <stdio.h>
#include <numeric>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define repone(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define Rep(j,n) for(int j=0;j<(int)(n);++j)
#define Repo(j,o,n) for(int j=o;j<(int)(n);++j)
#define Repone(j,n) for(int j=1;j<(int)(n);++j)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define int long long
#define pb(a) push_back(a)
#define pbpair(a,b) push_back(make_pair(a,b))
#define MOD 1000000007
#define INF 9223372036854775807
#define pairint pair<int,int>
int gcd( int x, int y ){ return y ? gcd(y, x%y) : x; }
signed main() {
int x=0,y=0,z=0,w=0,n=0,m=0;
int a=0,b=-1,c=0,d=0;
char Char =0;
while (true) {
  b=-1;
rep(i,5){
  std::cin >> x>>y;
if(x==0&&y==0)return 0;
if(b<x+y){
  Char=i+65;
  b=x+y;
}
}
std::cout <<Char<<" "<<b<< '\n';
}
  }

C++: #include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
#include <bitset>

using namespace std;


signed main(){
    
    while(1){
    vector<pair<int, char>> vp(5);
    vp[0].second = 'A';   
    vp[1].second = 'B';   
    vp[2].second = 'C';   
    vp[3].second = 'D';   
    vp[4].second = 'E';
    bool flag = true;
    for(int i = 0; i < 5; i++){
        int a, b; cin >> a >> b;
        if(a == 0 and b == 0){
            flag = false;
            break;
        }
        vp[i].first = a + b;
    }

    if(flag == false) break;

    sort(vp.rbegin(), vp.rend());
    cout << vp[0].second << " " << vp[0].first << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#include<map>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define CC puts("-------ok--------");
#define all(in) in.begin(), in.end()
using namespace std;
typedef pair<int, int> pii;
#define MAX 99999999
int main(){
    pii temp; pii f=pii(0,0);
    pii ans=pii(0,-INF);
    while(cin>>temp.first>>temp.second,temp!=f){
        ans=pii(0,temp.first+temp.second);
        for(int i=1;i<=4;i++){
            cin>>temp.first>>temp.second;
            if(temp.first+temp.second>ans.second){ans.first=i; ans.second=temp.first+temp.second;}
        }
        char u[]={"ABCDE"};
        cout<<u[ans.first]<<" "<<ans.second<<endl;
        }
    
}

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

using namespace std;

int main(){

	int s1,s2;
	while(cin>>s1>>s2&&!(s1==0&&s2==0)){
		vector<pair<int,char> > v;
		v.push_back(make_pair(s1+s2,'A'));
		for(int i = 0; i < 4; i++){
			cin>>s1>>s2;
			v.push_back(make_pair(s1+s2,'B'+i));
		}
		sort(v.begin(),v.end(),greater<pair<int,char> >());
		cout<<v[0].second<<" "<<v[0].first<<endl;
	}


	return 0;
}

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