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

int main() {
	int a,b;
	int i=0;
	int dt[5];
	while(cin >> a >> b) {
		if (i==0&&a==0&&b==0) break;
		dt[i] = a+b;
		i++;
		if (i==5) {
			int pos = 0;
			int max = dt[0];
			for (int j=0; j<5; j++) {
				if (max < dt[j]) {
					max = dt[j];
					pos = j;
				}
			}
			cout << (char)((int)'A'+pos) << ' ' << max << endl;
			i = 0;
		}
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
 
int main(){
  int s1,s2;
  while(cin >> s1 >> s2,s1||s2){
    int ans = 0, val = s1+s2;
 
    for(int i=1;i<5;i++){
      cin >> s1 >> s2;
      if(val < s1 + s2){
    ans = i;
    val = s1 + s2;
      }
    }
    cout << (char)('A'+ans) << " " << val << endl;
  }
}

C++: #include<bits/stdc++.h>
using namespace std;
main(){
  while(1){
    int noon,afternoon,max=0,maxn=-1;
    for(int i=0;i<5;i++){
      cin>>noon>>afternoon;
      if(noon==afternoon&&afternoon==0){
	return 0;
      }
      if(max<noon+afternoon){
	max=noon+afternoon;
	maxn=i;
      }
    }
    char a='A'+maxn;
    cout<<a<<" "<<max<<endl;
  }
}

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

C++: #include<stdio.h>
int main(void)
{
	int x,y,i,max,j;
	int s1[6],s2[6];
	char omise[6]={'A','B','C','D','E'};
	max=-1;
	j=0;
	for(i=0;i<5;i++){
		scanf("%d %d",&s1[i],&s2[i]);
	}
	while(!(s1[0]==0 && s2[0]==0)){
		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;
		}
		for(i=0;i<5;i++){
			scanf("%d %d",&s1[i],&s2[i]);
		}
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){

  int a[5],a1,a2,i,j;

  while(cin>>a1>>a2,a1){

    int b[5]={0,1,2,3,4};
    a[0]=a1+a2;
    for(i=1;i<5;i++){
      cin>>a1>>a2;
      a[i]=a1+a2;
    }

    for(i=0;i<4;i++){
      for(j=0;j<4;j++){
        if(a[j]<a[j+1]){
            int blank;
            blank=a[j];
            a[j]=a[j+1];
            a[j+1]=blank;
            blank=b[j];
            b[j]=b[j+1];
            b[j+1]=blank;
        }
      }
    }
    char team;
    team='A'+b[0];
    cout<<team<<" "<<a[0]<<endl;

  }

  return 0;


}

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;
            a[i] += b;
            if(a[i] == 0)
                return 0;
        }

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

C++: #include<stdio.h>
int main(void)
{
    char str[7] = { "\nABCDE" };
    int i, s1[6], s2[6], temp[6], max=0,max_s=0;
        for (i = 1; i <= 5; i++) {
            scanf("%d %d", &s1[i], &s2[i]);
            temp[i] = s1[i] + s2[i];
            if (max < temp[i]) {
                max = temp[i];
                max_s = i;
            }
            if (s1[1] <= 0 && s2[1] <= 0) {
                break;                
            }
        }
        while (s1[1] > 0 && s2[1] > 0) {        
            for (i = 1; i <= 5; i++) {
                if (max == temp[i]) {
                    printf("%c %d\n", str[i], temp[i]);
                }
            }
            for (i = 1; i <= 5; i++) {
                scanf("%d %d", &s1[i], &s2[i]);
                temp[i] = s1[i] + s2[i];
                if (max < temp[i]) {
                    max = temp[i];
                    max_s = i;
                }
                if (s1[1] <= 0 && s2[1] <= 0) {
                    break;
                }
            }
        }
    return 0;
}

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

C++: #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
	vector<int> v(2);
	vector<vector<int> > s;
	int a,b,i=-1;
	while(cin>>a>>b,a){
		v[0]=a+b,v[1]=++i,s.push_back(v);
		if(i==4){
			sort(s.begin(),s.end());
			cout<<char('A'+s[i][1])<<" "<<s[i][0]<<endl;
			s.clear(); i=-1;
		}
	}
	return 0;
}

C++: #include "bits/stdc++.h"
using namespace std;

int main() {
	vector<pair<int, int> > pairs;
	string s = "ABCDE";

	bool ok = true;
	
	while (ok) {
		int max_v = 0, max_n = 0;

		for (int i = 0; i < 5; ++i) {
			int val1, val2;
			cin >> val1 >> val2;

			if (val1 == 0 && val2 == 0) {
				ok = false;
				break;
			}

			int all = val1 + val2;

			if (all > max_v) {
				max_v = all;
				max_n = i;
			}
		}

		if(ok != false) pairs.push_back(make_pair(max_n, max_v));
	}

	for (int i = 0; i < pairs.size(); ++i) {
		cout << s[pairs[i].first] << " " << pairs[i].second << endl;
	}

}

C++: // #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <locale>
#include <cctype>
#include <sstream>
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<VI> VVI;

#define MP make_pair
#define fastIO	cin.tie(0); ios::sync_with_stdio(false);
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
//for gcc (未test)
// #define FOREACH_IT(it,c)	for(typeof(c)::iterator it=(c).begin(); it!=(c).end(); ++it)
//for Visual Studio
#define foreach_it(type,it,c) for(type::iterator it=c.begin(); it!=c.end(); ++it)

void solveAndOutput(vector<pair<char, int> > list){
	int max = -1;
	char ansShopName = 'F';
	FOR(i, 0, list.size()){
		if (max < list[i].second){
			max = list[i].second;
			ansShopName = list[i].first;
		}
	}
	cout << (char)ansShopName << " " << max << endl;
}

int main(){
	int s1, s2, count = 0;
	char shopName = 'A';
	vector<pair<char, int> > list;
	fastIO;
	// s1&&s2ではWrongAnswerだった.販売個数に0が含まれているのでは...？
	while (cin >> s1 >> s2, s1||s2){
		list.push_back(MP(shopName + count, s1 + s2));
		count++;
		if (count == 5){
			solveAndOutput(list);

			list.clear();
			count = 0;
			shopName = 'A';
		}
	}
	return 0;
}