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 <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define repi(i,a,b) for(int i = (a); i < (b); i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

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

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

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(mp(sum,i));
		}
		if(flag)
			cout <<data.top().second<<" "<<data.top().first<<endl;
	}
	return 0;
}

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

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;
	int ma_idx, ma_s = 0;
	while(true){
		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", "ABCDE"[ma_idx], ma_s );
	}
	return 0;
}

C++: #include<stdio.h>



int main()
{
	int a ,b ;


	while( 1 )
	{
		scanf( "%d %d" ,&a ,&b ) ;


		if( ( a | b ) == 0 )
		{
			return 0 ;
		}


		char c = 'A' ;

		int ans = a + b ;


		for( int i = 0 ; i < 4 ; ++i )
		{
			scanf( "%d %d" ,&a ,&b ) ;



			if( ans < a + b )
			{
				ans = a + b ;

				++c ;
			}
		}



		printf( "%c %d\n" ,c ,ans ) ;
	}
}

C++: #include<iostream>

using namespace std;

int main()
{
  int a, b, c;
  char s;
  while(true)
  {
    cin >> a >> b;
    if(!a && !b)
      break;
    c = a + b;
    s = 'A';
    for(int i = 0; i < 4; i++)
    {
      cin >> a >> b;
      if(a + b > c)
      {
       	c = a + b;
	s = 'B' + i;
      }
    }
    cout << s << " " << c << endl;
  }
}

C++: #include<cstdio>
using namespace std;
int main(){
    int x,y;
    while(scanf("%d%d",&x,&y),x,y){
        int data=0;
        int q = 0;
        data = x+y;
        for(int i = 1;i <= 4; i++){
            scanf("%d%d",&x,&y);
            if(data < x+y){
                data = x+y;
                q = i;
            }
        }
        printf("%c %d\n",q+65,data);
    }
    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>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)

#define PB push_back
#define INF INT_MAX/3
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define CLR(a) memset(a,0,sizeof(a))

typedef long long int ll;

using namespace std;

int main(){
    while(true){
	vector< pair<int,string> > sh(5);
	int s1,s2;
	string a[] = { "A" , "B" , "C" , "D" , "E"};
	REP(i,5){
	    cin >> s1 >> s2;
	    if(s1 == 0 && s2 == 0) break;
	    sh.PB( pair<int,string>(s1+s2, a[i] ));
	}
	if(s1 == 0 && s2 == 0) break;
	sort(RALL(sh));
	cout << sh[0].second << " " << sh[0].first << endl;
    }
    return 0;
}

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",&a,&b);
    }
    return 0;
}

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

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(n) rep(i,n)
#define all(n) n.begin(),n.end()

int s[5];

int main()
{
    int n1, n2;
    while(cin >> n1 >> n2 && (n1 || n2))
    {
        s[0] = n1 + n2;
        REP(4){cin >> n1 >> n2; s[i+1] = n1 + n2;}
        int m = 0;

        REP(5)if(s[m] < s[i]) m = i;

        cout <<(char)('A' + m) << " " << s[m] << endl;
    }
    
    return 0;
}

C++: #include <iostream>
#include <stdio.h>
using namespace std;
int main(){
	int sale[5][3];
	while(1){
		scanf("%d %d",&sale[0][0],&sale[0][1]);
		if(sale[0][0]==0 && sale[0][1]==0) break;
		for(int i=1;i<5;i++){
			cin>>sale[i][0]>>sale[i][1];
		}
		for(int i=0;i<5;i++){
			sale[i][2] = sale[i][0]+sale[i][1];
		}

		int max = sale[0][2];
		int maxi = 0;
		for(int i=1;i<5;i++){
			if(max <sale[i][2]){
				max = sale[i][2];
				maxi = i;
			}
		}

		printf("%c %d\n",'A'+maxi,max);

	}

	return 0;
}

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