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

int main(){
	
	int d[5][2]={0};
	int max,u;
	while(cin>>d[0][0]>>d[0][1]){
	if(d[0][0]!=d[0][1]!=0){
		max=d[0][0]+d[0][1];
		u=0;
		for(int i=1;i<5;i++){
			cin>>d[i][0]>>d[i][1];
			int s=d[i][0]+d[i][1];
			if(max<s){
			max=s;
			u=i;
			}
		}
		switch(u){
		case 0: cout<<"A"<<" "<<max<<endl; break;
		case 1: cout<<"B"<<" "<<max<<endl; break;
		case 2: cout<<"C"<<" "<<max<<endl; break;
		case 3: cout<<"D"<<" "<<max<<endl; break;
		case 4: cout<<"E"<<" "<<max<<endl; break;
		}
	}
		else
			break;
		
	}
		
	
}

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<stdio.h>
#include<algorithm>
int main()
{
	int a[5],x,y,i,*p;
	for(;;)
	{
		for(i=0;i<5;++i)
		{
			if(scanf("%d%d",&x,&y),!x)return 0;
			a[i]=x+y;
		}
		p=std::max_element(a,a+5);
		printf("%c %d\n",p-a+'A',*p);
	}
	return 1;
}

C++: /*
 * src.cpp
 *
 *  Created on: 2016/07/27
 *      Author: joi
 */

#include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)

typedef pair<int,char> P;

P p[5];

int main(){
	int a,b;
	do{
		cin>>a>>b;
		if (a || b){
			p[0]=P(a+b,'A');
			FOR(i,1,5){
				cin>>a>>b;
				p[i]=P(a+b,'A'+i);
			}
			sort(p,p+5);
			cout<<p[4].second<<" "<<p[4].first<<endl;
		}
	}while (a || b);
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<stdio.h>
using namespace std;
int main(){
    int a[100],b[100],c[100],d[100],e[100],A,B,C,D,E,am=0,bm=0,cm=0,dm=0,em=0,i,j,max;
    char x;
    am=a[0];bm=b[0];cm=c[0];dm=b[0];em=e[0];
    for(i=1;i<100;i++){
        for(A=0;A<2;A++){
            cin>>a[A];
            am+=a[A];
        }
        if(a[A]==0){
            break;
        }
        for(B=0;B<2;B++){
            cin>>b[B];
            bm+=b[B];
        }
        if(b[B]==0){
             break;
        }
        for(C=0;C<2;C++){
            cin>>c[C];
            cm+=c[C];
        }
        if(c[C]==0){
            break;
        }
        for(D=0;D<2;D++){
            cin>>d[D];
            dm+=d[D];
        }
        if(d[D]==0){
            break;
        }
        for(E=0;E<2;E++){
            cin>>e[E];
            em+=e[E];
        }
        if(e[E]==0){
            break;
        }
        
        if(am<bm){
            max=bm;
            x='B';
        }else{
            max=am;
            x='A';
        }
        if(max<cm){
            max=cm;
            x='C';
        }
        if(max<dm){
            max=dm;
            x='D';
        }
        if(max<em){
            max=em;
            x='E';
        }
        cout<<x<<" "<<max<<endl;
        max=0;
        am=0;bm=0;cm=0;dm=0;em=0;
    }
    return 0;
}

C++: #include <stdio.h>

int main()
{
        int shop[5];
        int m,e;
        int i=0,top_s,max=0;

        while (scanf("%d %d", &m, &e) && !(m == 0 && e == 0)) {

                shop[i] = m+e;
                if (shop[i] > max) {
                        max = shop[i];
                        top_s = i;
                }

                i++;
                if (i > 4) {
                        printf("%c %d", top_s+'A', max);
                        i = max = 0;
                }
        }
        return 0;
}

C++: 
#include <iostream>
#include<string>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
    int a[5],b[5],c[5],i,max=0,num=0;
    string str[5]={"A","B","C","D","E"};
    while(cin>>a[0]>>b[0]){
        if(a[0]==0&&b[0]==0)break;
        for(i=1;i<5;i++){
            cin>>a[i]>>b[i];
        }
        for(i=0;i<5;i++){
            c[i]=a[i]+b[i];
        }
        for(i=0;i<5;i++){
            if(max<=c[i]){
            max=c[i];
                num=i;
            }
        }
        cout<<str[num]<<" "<<max<<endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second

template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pll> pip;
const ll INF = 1ll<<29;
const ll MOD = 1000000007;
const double EPS  = 1e-9;

int main() {
	int s[5];
	int a, b;
	while (cin >> a >> b, a || b) {
		s[0] = a + b;
		FOR(i, 1, 5) {
			cin >> a >> b;
			s[i] = a + b;
		}
		
		pii ma(-1, 0);
		REP(i, 5) chmax(ma, pii(s[i], i));
		
		printf("%c %d\n", ma.se + 'A', ma.fi);
	}
	return 0;
}

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

C++: #include <cstdio>

using namespace std;

int main()
{
	int sa, sb;
	
	while (scanf("%d %d", &sa, &sb) && sa){
		int max = sa + sb;
		char ans = 'A';
		for (int i = 1; i < 5; i++){
			scanf("%d %d", &sa, &sb);
			if (max < sa + sb){
				max = sa + sb;
				ans = 'A' + i;
			}
		}
		printf("%c %d\n", ans, max);
	}
	
	return (0);
}

C++: #include <cstdio>

using namespace std;

int max( int a, int b, int c, int d, int e )
{
    int pre1,pre2;
    if( a < b )
    {
        pre1 = b;
    }
    else
    {
        pre1 = a;
    }
    if( c < d )
    {
        pre2 = d;
    }
    else
    {
        pre2 = c;
    }
    if( pre1 < pre2 )
    {
        if( pre2 < e )
        {
            return e;
        }
        else
        {
            return pre2;
        }
    }
    else
    {
        if( pre1 < e )
        {
            return e;
        }
        else
        {
            return pre1;
        }
    }
}

int main()
{
    while( 1 )
    {
        int a = 0,b = 0,c = 0, d = 0,e = 0;
        int num1,num2;
        scanf( "%d %d\n", &num1, &num2 );
        if( num1 == 0 && num2 == 0 ) break;
        a += num1 + num2;
        scanf( "%d %d\n", &num1, &num2 );
        b += num1 + num2;
        scanf( "%d %d\n", &num1, &num2 );
        c += num1 + num2;
        scanf( "%d %d\n", &num1, &num2 );
        d += num1 + num2;
        scanf( "%d %d\n", &num1, &num2 );
        e += num1 + num2;
        int ma = max( a,b,c,d,e );
        if( ma == a )
        {
            printf( "A %d\n", a );
        }
        else if( ma == b )
        {
            printf( "B %d\n", b );
        }
        else if( ma == c )
        {
            printf( "C %d\n", c );
        }
        else if( ma == d )
        {
            printf( "D %d\n", d );
        }
        else if( ma == e )
        {
            printf( "E %d\n", e );
        }
    } 
    return 0;
}