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>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

using namespace std;

#define rep(i,n) for(int i=0; i<(n); i++)
#define repc(i,s,e) for(int i=(s); i<(e); i++)
#define pb(n) push_back((n))
#define mp(n,m) make_pair((n),(m))
#define all(r) r.begin(),r.end()
#define fi first
#define se second

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<ll> vl;
typedef vector<vl> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;






int main() {
	vector<pii> v(5, pii(0, 0));
	int a, b;
	while (1) {
		for (int i = 0; i < 5; i++) {
			cin >> a >> b;
			v[i].second = i;
			v[i].first = a + b;
		}
		if (cin.eof())break;
		sort(all(v));
		cout << (char)('A' + v[4].second) << " " << v[4].first << endl;
	}
}

C++: #include <iostream>

using namespace std;

int n, m;

int main()
{
	char c1 = 'A', c2 = 'A';
	int ans = 0;
	while (cin >> n >> m && (n || m))
	{
		if(n + m > ans)
		{
			c1++;
			ans = n + m;
		}
		c2++;
		if(c2 > 'E')
		{
			cout << --c1 << " " << ans << endl;
			ans = 0;
			c1 = 'A';
			c2 = 'A';
		}
	}
}

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

int main(){
  int tmp,tmp2;
  while(1){
    map <int,char,greater<int> > pi;
    map <int,char,greater<int> >::iterator itr;
    for(int i=0;i<5;i++){
      cin >> tmp >> tmp2;
      if(tmp == 0 && tmp2 == 0) return 0;
      pi.insert(map<int,char,greater<int> >::value_type(make_pair(tmp+tmp2,i+'A')));
    }
    itr = pi.begin();
    cout << itr->second << " " << itr->first << endl;
  }
}

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

int main()
{
	int a, b;
	bool check = false;

	while (1){
		int max = 0;
		int num;

		for (int i = 0; i < 5; i++){
			cin >> a >> b;
			if (a == 0 && b == 0){
				check = true;
				break;
			}

			int sum = a + b;

			if (sum > max){
				max = sum;
				num = i;
			}
		}

		if (check){
			break;
		}

		printf("%c %d\n", num + 0x41, max);
	}

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

int main(){
    int a, b;
    while(cin >> a >> b, a != 0 || b != 0){
        int max_shop = 0;
        int max = a + b;
        for(int i=1; i<5; i++){
            cin >> a >> b;
            if(max < a + b){
                max = a + b;
                max_shop = i;
            }
        }
        cout << (char)('A' + max_shop) << " " << max << endl;
    }
    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||i!=-1){
		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<stdio>
int main(void)
{
    int a[5],b[5];
	int i,max,sum[5];
	char c2,c[5]={'A','B','C','D','E'};
	while (scanf("%d %d",&a[0],&b[0])!=EOF){
	    if(a[0]==0&&b[0]==0) break;
		sum[0]=a[0]+b[0];
		max=sum[0];
		c2='A';
		for(i=1;i<5;i++){
		    scanf("%d %d",&a[i],&b[i]);
			sum[i]=a[i]+b[i];
		}
		for(i=0;i<5;i++){
            if(max<sum[i]){
			    max=sum[i];
				c2=c[i];
			}
		}
		printf("%c %d\n",c2,max);
	}
	return 0
}

C++: #include <iostream>
using namespace std;
main(){
int s,t;
while(cin>>s>>t){
if((s|t)==0) break;
int m=s+t,mi=0;
for(int i=1;i<5;i++){
cin>>s>>t;
if(m<s+t){
m=s+t;
mi=i;
}
}
cout<<(char)('A'+mi)<<" "<<m<<endl; 
}
}

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
   int am,pm,maxe,num;
   char arfabet[]="ABCDE";
   while(cin>>am&&cin>>pm&&am!=0&&pm!=0){
        maxe=am+pm;num=0;
        for(int i=1;i<5;i++){
            cin>>am>>pm;
            if(am+pm>maxe){
                maxe=pm+am;num=i;
            }

        }
         cout<<arfabet[num]<<" "<<maxe<<endl;
   }
}

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

int main()
{
  int n, m;
  
  while (cin >> n >> m, n || m){
    int maxn = n + m;
    char s = 'A', store = s;
    for (int i = 1; i < 5; i++){
      cin >> n >> m;
      int sum = n + m;
      if (maxn < sum){
        maxn = sum;
        store = s + i;
      }
    }
    cout << store << ' ' << maxn << endl;
  }
 
  return (0);
}

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

int main(){
  int a,b,mx;

  while( cin >> a >> b, a+b ){
    char ans = 'A';
    mx =  a + b;
      for(int i = 1 ; i < 5 ; i++ ){
	cin >> a >> b;
	if(mx < a+b){
	  mx = a+b;
	  ans = char('A'+i); 
	}
      }
      cout << ans <<' '<<mx << 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;
	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>
using namespace std;

int main() {
	int a[4];
	while(1){
		for(int i=0;i<5;i++){
			int tmp,TMP; cin >> tmp >> TMP;
			if(!tmp && !TMP) return 0;
			a[i]=tmp+TMP;
		}
		int n=0,tmp=a[0];
		for(int i=1;i<5;i++){
			if(a[i]>tmp) tmp=a[i],n=i;
		}
		char ch='A'; ch+=n;
		cout << ch << ' ' << tmp << '\n' ;
	}
}

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

int main(){
  int a, b;
  while(cin >> a >> b, a | b){
    char ans = 'A';
    int m = a + b;
    for(int i = 1;i < 5;i++){
      cin >> a >> b;
      if(a + b > m){
	ans = i + 'A';
	m = a + b;
      }
    }
    cout << ans << " " << m << 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 <iostream>
#include <vector>
#include <algorithm>
#include <string>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

int main()
{
	int a,b;
	string store[5] = {"A","B","C","D","E"};

	while(cin >> a >> b)
	{
		if(a == 0 && b == 0)
		{
			break;
		}

		vector<pair<int,string> > v;
		v.push_back(make_pair(a+b,store[0]));
		
		REP(i,1,5)
		{
			cin >> a >> b;
			v.push_back(make_pair(a+b,store[i]));		
		}

		sort(v.begin(),v.end(),greater<pair<int,string> >());

		cout << v[0].second << " " << v[0].first << endl;
	}
	return 0;
}