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<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<cstdio>
#include<cstring>
#include<algorithm>
#include<functional>
#include<vector>
#include<stack>
#include<queue>
#include<iostream>
using namespace std;
int main(void)
{
	int sum=0,mx=-1,ss,s,pl;
	char pp[5]={'A','B','C','D','E'};
	while(1) {
		cin>>s>>ss;
		mx=s+ss;pl=0;
		if(s==0 && ss==0) break;
		for(int i=1;i<5;i++) {
			sum=0;
			cin>>s>>ss;
			sum=s+ss;
			if(mx<sum) {mx=sum;pl=i;}
		}
		cout<<pp[pl]<<" "<<mx<<endl;
	}
}

C++: #include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <iostream>
#include <sstream>
#include <climits>
#include <cfloat>
#include <complex>

using namespace std;

int main()
{
	while (true)
	{
		int am[5], pm[5];
		for (int i = 0; i < 5; ++i)
			scanf("%d %d", am+i, pm+i);
		if (!(*am | *pm))
			break;

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

	return 0;
}

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

int main() {
    int A1, A2, B1, B2, C1, C2, D1, D2, E1, E2;
    while (cin >> A1 >> A2, (A1 || A2)) {
        cin >> B1 >> B2 >> C1 >> C2 >> D1 >> D2 >> E1 >> E2;
        int mx = 0;
        string res = "";
        if (mx < A1 + A2) {
            mx = A1 + A2;
            res = "A";
        }
        if (mx < B1 + B2) {
            mx = B1 + B2;
            res = "B";
        }
        if (mx < C1 + C2) {
            mx = C1 + C2;
            res = "C";
        }
        if (mx < D1 + D2) {
            mx = D1 + D2;
            res = "D";
        }
        if (mx < E1 + E2) {
            mx = E1 + E2;
            res = "E";
        }
        cout << res << " " << mx << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <time.h>
#include <math.h>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <sstream>
#include <string>
using namespace std;
#define FOR(I,F,N) for(int I = F; I < (int)(N); I++)
#define rep(i, n) FOR(i, 0, n)
#define FIN(V) cout<<V<<endl
#define pb push_back
#define INF (1 << 30)
typedef pair<int, int> P;
typedef long long ll;
typedef priority_queue<int> pq;
int StrToInt(string);
string IntToStr(int);
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};

int main(void){

	while(1){
		char c = 'A';
		int maxi = 0;
		bool flag = 0;
		rep(i, 5){
			int a, b;
			cin >> a >> b;
			if(a == b && a == 0){flag = 1;break;}
			if(maxi <= (a+b)){
				maxi = a+b;
				c = 'A'+i;
			}
		}
		if(flag)break;
		cout << c << " " << maxi << endl;
	}

	return 0;
}



int StrToInt(string s){
	stringstream ss;
	ss << s;
	int val;
	ss >> val;
	return val;
}
string IntToStr(int i){
	stringstream ss;
	ss << i;
	return ss.str();
}

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 && i == 5)) {

                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<stdio.h>
int main(void)
{
	int n,a,s,i,x[100],max,flg,c;
	while(1){
		scanf("%d %d",&a,&s);
		if(a==0&&s==0) break;
		else{
			x[0]=a+s;
		}	
		c=0;
			for(i=1;i<5;i++){
				scanf("%d %d",&a,&s);	
					x[i+1]=a+s;
			}
		max=-1;
			for(i=0;i<5;i++){
				if(max<x[i]){
					max=x[i];
					c++;
				}
			}
		if(c==1){
			printf("A %d\n",max);
		}
		else if(c==2){
			printf("B %d\n",max);
		}
		else if(c==3){
			printf("C %d\n",max);
		}
		else if(c==4){
			printf("D %d\n",max);
		}
		else if(c==5){
			printf("E %d\n",max);
		}		
	}
	return 0;
}

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","ABCDE"[p-a],*p);
	}
}

C++: #include<iostream>
#include<algorithm>
#include<stdio.h>
using namespace std;
int main(){
    int n,sum[5]={0},am,pm,i=0,max=-1000,num;
    bool bo=false;
    char ans;
    while(1){
        for(i=0;i<5;i++){
            cin>>am>>pm;
            if(am==0 && pm==0){
                bo=true;
                break;
            }
            sum[i]=am+pm;
        }
        if(bo){
            break;
        }
        for(int i=0;i<5;i++){
            if(sum[i]>max){
                max=sum[i];
                num=i;
            }
        }
        ans='A'+num;
        cout<<ans<<" "<<max<<endl;
        max=-1000;
    }
    return 0;
}

C++: #include <cstdio>
#define buf 10000
using namespace std;
int B[10];
void BubbleSort(void);

int main(void){
  int i,n,m,A[20001];
  char str[buf];

  for( ; ; ){
    for(i=0;i<5;i++){
      fgets(str,sizeof(str),stdin);
      sscanf(str,"%d %d",&n,&m);
      if(n==0 && m==0) break;
      B[i]=n+m; A[n+m]=i;
    }
    BubbleSort();
    printf("%c %d\n",'A'+A[B[0]],B[0]);
  }
  return 0;
}

void BubbleSort(void){
  int i,j,tmp;
  for(i=0;i<4;i++){
    for(j=4;j>i;j--){ 
      if(B[j] > B[j-1]){
        tmp = B[j-1];
        B[j-1] = B[j];
        B[j] = tmp;
      }
    }
  }
}

C++: #include <iostream>
#include <algorithm>

using namespace std;

int main(void){

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