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 a, b, t, r;

int main(){
	while (cin >> a >> b && a|b != 0) {
		t = a + b;
		r = 0;
		for (int i = 1; i < 5; i++) {
			cin >> a >> b;
			if (t < a + b) {
				r = i;
				t = a + b;
			}
		}
		char c = 'A' + r;
		cout << c << " " << t << endl;
	}

	return 0;
}

C++: #include<iostream>

using namespace std;

int main(){
	int a[2][5];
	char ans[5]={'A','B','C','D','E'};
	int max,s,m;
	while(cin>>a[0][0]>>a[1][0],a[0][0]!=0){
		max=a[0][0]+a[1][0];
		m=0;
		for(int i=1;i<5;i++){
			cin>>a[0][i]>>a[1][i];
				s=a[0][i]+a[1][i];
				if(s>max){max=s;m=i;}
		}
		cout<<ans[m]<<" "<<max<<endl;
	}

}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()

using namespace std;

typedef unsigned int uint;
typedef long long ll;

#define MAX 1000001
int main(){
  int a,b;
  
  while(scanf("%d%d",&a,&b),a+b){
    vector<pair<int,int> > v;
    v.push_back(mp(a+b,0));
    REP(i,4){
      scanf("%d%d",&a,&b);
      v.push_back(mp(a+b,i+1));
    }
    sort(v.rbegin(), v.rend());
    printf("%c %d\n",'A'+v[0].s, v[0].f);
  }

  return 0;
}

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

	while(true){

		int s1,s2;
		int max = 0,x = 0;

		cin >> s1 >> s2;

		if(s1 == 0 && s2 == 0)
			break;

		max = s1 + s2;
	
		for(int i=1 ;i<5 ;i++){

			cin >> s1 >> s2;

			if(max < (s1+s2)){
				max = s1 + s2;
				x = i;
			}
		}


		if(x==0)
			cout << 'A' << ' ' << max;
		if(x==1)
			cout << 'B' << ' ' << max;
		if(x==2)
			cout << 'C' << ' ' << max;
		if(x==3)
			cout << 'D' << ' ' << max;
		if(x==4)
			cout << 'E' << ' ' << max;
		}
		return 0;
}

C++: #include<stdio.h>
#include<string.h>
int main(void)
{
	int a[5],b[5],d,i,j;
	char c[5]="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]);
			if(a[i]+b[i]>d){
				d=a[i]+b[i]; j=i;
			}
		}
		printf("%c %d\n",c[j],d);
		scanf("% %d",&a[0],&b[0]);
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

int main() {
    int x, y;
    while(cin >> x >> y, x){
        vector<int> v(5);
        v[0] = x+y;
        for (int i = 1; i < 5; ++i) {
            int a, b;
            cin >> a >> b;
            v[i] = a+b;
        }
        int res = max_element(v.begin(),v.end()) - v.begin();
        printf("%c %d\n", 'A'+res, v[res]);
    }

    return 0;
}

C++: // 2011/07/31 Tazoe

#include <iostream>
using namespace std;

int main()
{
	while(true){
		int s[5][2];
		cin >> s[0][0] >> s[0][1];
		if(s[0][0]==0&&s[0][1]==0)
			break;

		for(int i=1; i<5; i++)
			cin >> s[i][0] >> s[i][1];

		int max_i = 0;
		int max_s = s[0][0]+s[0][1];
		for(int i=1; i<5; i++)
			if(s[i][0]+s[i][1]>max_s){
				max_i = i;
				max_s = s[i][0]+s[i][1];
			}

		cout << (char)('A'+max_i) << ' ' << max_s << endl;
	}

	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int a,b,s,i,max,f,flg;
	flg=0;
	while(1){
		max=-1;
	for(i=0;i<5;i++){
		scanf("%d %d",&a,&b);
		s=a+b;
		if(a==0 && b==0){
			flg=1;
			break;
		}
		if(max<s){
			max=s;
			f=i;
		}
	}
		if(flg==1){
			break;
		}
	if(f==0){
		printf("A %d\n",max);
	}
	if(f==1){
		printf("B %d\n",max);
	}
	if(f==2){
		printf("C %d\n",max);
	}
	if(f==3){
		printf("D %d\n",max);
	}
	if(f==4){
		printf("E %d\n",max);
	}
	}
	return 0;
}

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

int main(){

  int a,b,i = 0,z[100],m,n;
  
  while(1){
    int m = 0,n = 0;

    cin >> a >> b;
    if(a == 0 && b == 0 && i == 0) break;

    z[i] = a + b;
    i++;

    if(i == 5){
      for(i=0;i<5;i++){
	if(m < z[i]){
	  m = z[i];
	  n = i;
	}
      }
      printf("%c %d\n",'A'+n,m);
      i = 0;
    }
  }
}

C++: #include <iostream>
using namespace std;
#define rep2(x,from,to) for(int x=(from);x<(to);++(x))
#define rep(x,to) rep2(x,0,to)
int main(){
	int am,pm;
	while(cin >> am >> pm) {
		if(am==0&&pm==0) break;
		int ret = am + pm;
		char shop = 'A';
		rep2(i,1,5) {
			cin >> am >> pm;
			if(ret < am + pm) {
				ret = am + pm;
				shop = 'A' + i;
			}
		}
		cout << shop << " " << ret << endl;
	}
	return 0;
}

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

int main() {
    while (true) {
        int sales[5][2];
        for (int i = 0; i < 5; i++) {
            cin >> sales[i][0] >> sales[i][1];
        }
        if (sales[0][0] == 0 && sales[0][1] == 0) {
            break;
        }
        int max[2] = {};
        for (int i = 0; i < 5; i++) {
            int s = sales[i][0] + sales[i][1];
            if (max[1] < s) {
                max[0] = i;
                max[1] = s;
            }
        }
        printf("%c %d\n", 'A' + max[0], max[1]);
    }
}

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;
			if(max < a+b) {
				max =a+b;
				maxchar=i;
			}
		}
		cout << c[maxchar] << " " << max << endl;
	}
}

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;
			if(max < a+b) {
				max =a+b;
				maxchar=i;
			}
		}
		cout << c[maxchar] << " " << max << endl;
	}
}

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

typedef long long ll;
typedef pair<int, int> P;

#define pb push_back
#define rep(i, a, n) for(int i = (a); i < (n); i++)
#define dep(i, a, n) for(int i = (a); i >= (n); i--)
#define mod 1e9+7

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

int main() {
  int b, c;
  int a[5];
  while(cin >> b >> c) {
    if(!b && !c) return 0;
    a[0] = b + c;
    int m = a[0];
    rep(i, 0, 4) cin >> b >> c, a[i + 1] = b + c, m = max(m, a[i + 1]);
    rep(i, 0, 5) if(a[i] == m) cout << (char)('A' + i) << " " << m << endl;
  }
}

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;
}