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<climits>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
#include <string>
#include <complex>
#include <functional>
using namespace std;
typedef pair<int,int> P;
double dat[100][100];
double dp[200][100];//動的計画法
int main(){
    int s1,s2,n,max,i;
    while(cin>>s1>>s2,s1){
        max=s1+s2;
        n=i=0;
        i++;
        while(i!=5){
            cin>>s1>>s2;
            if(max<s1+s2){
                max=s1+s2;
                n=i;
            }
            i++;
        }
        switch(n){
            case 0:
                cout<<"A ";
            break;
            case 1:
                cout<<"B ";
            break;
            case 2:
                cout<<"C ";
            break;
            case 3:
                cout<<"D ";
            break;
            default:
                cout<<"E ";
            break;
        }
        cout<<max<<endl;
    }
}

C++: #include <iostream>

using namespace std;

int main(int argc, char **argv)
{
	int a, b, tmp, tmp2;
	char w;
	while(1){
		cin >> a >> b;
		if(a == 0 && b == 0){
			break;
			cout << endl;
		}
		
		w = 'A';
		tmp = a + b;
		tmp = 0;
		for(int i = 1; i <= 4; i++){
			cin >> a >> b;
			if(tmp < (a+b)){
				tmp = a + b;
				tmp2 = i;
			}
		}
		
		cout << (char)(w+tmp2) << " " << tmp << endl;
	}
	
	
	return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
	int s1,s2,max=0,mise;
	while(1){
		for(int i=1 ; i<=5 ; ++i){
			cin >> s1 >> s2;
			if(s1==0 && s2==0)break;
			if(max<s1+s2){
				max=s1+s2;
				mise=i;
			}
		}
		if(s1==0 && s2==0)break;
		switch(mise){
		case 1:
			cout << "A " << max << endl;
			break;
		case 2:
			cout << "B " << max << endl;
			break;
		case 3:
			cout << "C " << max << endl;
			break;
		case 4:
			cout << "D " << max << endl;
			break;
		case 5:
			cout << "E " << max << endl;
			break;
		}
	}
	return 0;
}

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 && b[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<iostream>
#include<algorithm>
using namespace std;
int s,a,b,ans;
char ch;
int main(){
  while(1){
    ans=-1;
    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;
char shops[] = {'A', 'B', 'C', 'D', 'E'};

int main () {
	int a, b, maxTotal;
	char maxShop;
	while (maxShop = shops[0], cin >> a >> b, a || b) {
		maxTotal = a + b;
		for (int i = 1; i < 5; i++) {
			cin >> a >> b;
			if (a + b > maxTotal) {
				maxTotal = a + b;
				maxShop = shops[i];
			}
		}
		cout << maxShop << ' ' << maxTotal << endl;
	}
	return 0;
}

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

using namespace std;

#define all(c) ((c).begin()), ((c).end())
#define dump(c) cerr << "> " << #c << " = " << (c) << endl;
#define iter(c) __typeof((c).begin())
#define tr(i, c) for (iter(c) i = (c).begin(); i != (c).end(); i++)
#define REP(i, a, b) for (int i = a; i < (int)(b); i++)
#define rep(i, n) REP(i, 0, n)
#define mp make_pair
#define fst first
#define snd second
#define pb push_back

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<string> vs;
typedef pair<int,int> pii;

const int INF = 1 << 29;
const double EPS = 1e-10;

template<typename T1,typename T2>
ostream& operator<<(ostream& os,const pair<T1,T2>& p){
    return os<<'('<<p.first<<','<<p.second<<')';
}
template<typename T>
ostream& operator<<(ostream& os,const vector<T>& a){
    os<<'[';
    rep(i,a.size()) os<<(i?" ":"")<<a[i];
    return os<<']';
}



int main() {
    for(; ; ) {
        int p;
        int ans = 0;
        rep(i, 5) {
            int s1, s2; cin >> s1 >> s2;
            if (s1 == 0 && s2 == 0) goto end;
            if (ans < s1 + s2) {
                ans = s1 + s2;
                p = i;
            }
        }
        cout << (char)('A' + p) << ' ' << ans << endl;
    }
    
end:;
    return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
	int s1[5],s2[5],namae;
	char demise[] = {'A','B','C','D','E'};
	while(1){
		int max=0;
		for(int i=0 ; i<5 ; ++i){
			cin >> s1[i] >> s2[i];
			if(s1[0]==0 && s2[0]==0)break;
		}
		if(s1[0]==0 && s2[0]==0)break;
		for(int i=0 ; i<5 ; ++i){
			if(max<s1[i]+s2[i]){
				max=s1[i]+s2[i];
				namae=i;
			}
		}
		cout << demise[namae] << " " << max << endl;
	}
	return 0;
}

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

int main()
{
	int s1,s2,ms,mn;
	
	while(cin >> s1 >> s2, (s1||s2))
	{
		ms = 0; mn = s1+s2;
		for(int i=1; i<5; i++)
		{
			cin >> s1 >> s2;
			if(s1+s2>mn)
			{
				ms = i;
				mn = s1+s2;
			}
		}
		cout << (char)('A'+ms) << " " << mn << endl;
	}

	return 0;
}