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

    cout << maxi << maxn << endl;
  }
}

C++: #define _USE_MATH_DEFINES
#include<cstdio>
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<stack>
#include<cmath>
#include<climits>
using namespace std;

int main(){
	int S1, S2;
	while(true){
		int ma_idx, ma_s = 0;
		for(int i = 0; i < 5; i++){
			cin >> S1 >> S2;
			if(S1 == 0 && S2 == 0) return 0;
			if(ma_s < S1 + S2){
				ma_idx = i; ma_s = S1 + S2;
			}
		}
		printf("%c %d\n", 'A' + ma_idx, ma_s );
	}
	return 0;
}

C++: #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;

//// < "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\b.txt"


int main() {
	vector<pair<int, int>>vs(5);
	while (cin >> vs[0].first >> vs[0].second) {
		if (vs[0].first == 0)break;
		for (int i = 1; i < 5; ++i) {
			cin >> vs[i].first >> vs[i].second;
		}
		int ans=0;
		int sum = 0;
		for (int i = 0; i < 5; ++i) {
			if (sum < vs[i].first + vs[i].second) {
				sum = vs[i].first + vs[i].second;
				ans = i;
			}
		}
		cout << char('A' + ans) << " " << sum << endl;
	}
	return 0;
}

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>
#include <vector>
using namespace std;

int main()
{
  vector<int> s(10);
  while (cin >> s[0] >> s[1]) {
    if ((s[0]|s[1]) == 0)
      break;

    for (int i = 2; i < 10; ++i)
      cin >> s[i];

    int minIndex = 0;
    for (int i = 2; i < 10; i += 2) {
      if (s[i]+s[i+1] > s[2*minIndex]+s[2*minIndex+1])
	minIndex = i/2;
    }

    cout << static_cast<char>('A'+minIndex) << " " << s[2*minIndex]+s[2*minIndex+1] << endl;
  }
  return 0;
}

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;

//function---------------------------------------------------------------------------------------------------------------------
int main() {
	while ( scanf( "%d %d", &a, &b ) ) {
		if ( a == 0 && b == 0 ) {
			return 0;
		}
		int mx = a + b;
		c = 0;
		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;
}

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<utility>
#include<algorithm>
using namespace std;
int a,b;
main()
{
    while(cin>>a>>b,a+b)
    {
        pair<int,char>p[5];
        p[0].first=a+b;
        for(int i=0;i<5;i++)p[i].second='A'+i;
        for(int i=1;i<5;i++)
        {
            cin>>a>>b;
            p[i].first=a+b;
        }
        sort(p,p+5);
        cout<<p[4].second<<" "<<p[4].first<<endl;
    }
}

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

struct data{
    char name;
    int sell;
    data(char n, int s) : name(n), sell(s) {}
    bool operator<(const data other) const{
        return sell < other.sell;
    }
};

int main(){
    while(1){
        int a, b;
        cin >> a >> b;
        if(a + b == 0)  break;

        vector<data> res;
        res.push_back(data('A', a+b));

        for(int i = 1; i < 5; i++){
            cin >> a >> b;
            res.push_back(data((char)('A'+i), a+b));
        }

        sort(res.rbegin(), res.rend());

        cout << res[0].name << " " << res[0].sell << endl;
    }
    return 0;
}

C++: #include <iostream>

using namespace std;
 
int main()
{
    int s1[5],s2[5];
 
    while (true) {
	cin >> s1[0] >> s2[0];
	if (!s1[0] && !s2[0]) break;
 
	int max = s1[0] + s2[0], num = 1;
	for (int i = 1; i < 5; i++) {
	    cin >> s1[i] >> s2[i];
	    if (max < s1[i]+s2[i]) {
		max = s1[i] + s2[i];
		num = i + 1;
	    }
	}
	
	switch(num){
            case 1:
                cout << 'A';
                break;
            case 2:
                cout << 'B';
                break;
            case 3:
                cout << 'C';
                break;
            case 4:
                cout << 'D';
                break;
            case 5: 
                cout << 'E';
                break;
	}
	cout << ' ' << max << endl;
    }
    return 0;
}