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;

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

int main(){
	int s1,s2;
	while( cin >> s1 >> s2, s1||s2 ){
		int ms = s1+s2;
		int mi = 0;
		rep(i,4){
			cin >> s1 >> s2;
			if( ms < s1+s2 ){
				ms = s1 + s2;
				mi = i;
			}
		}
		cout << (char)('A'+mi) << " " << ms << endl;
	}
	return 0;
}

C++: #include<stdio.h>

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

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&&!y)return 0;
			a[i]=x+y;
		}
		p=std::max_element(a,a+5);
		printf("%c %d\n","ABCDE"[p-a],*p);
	}
}

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

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

int main(){
	int s1,s2;
	while( cin >> s1 >> s2, s1||s2 ){
		int ms = s1+s2;
		int mi = 0;
		rep(i,4){
			cin >> s1 >> s2;
			if( ms < s1+s2 ){
				ms = s1 + s2;
				mi = i+1;
			}
		}
		cout << (char)('A'+mi) << " " << ms << endl;
	}
	return 0;
}

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

int main(){
    while(1){
        int a,b,bm=0,s;
        for(int i=0;i<5;i++){
            cin >> a >> b;
            if(a==0&&b==0)goto end;
            if(bm<a+b){
                bm=a+b;
                s=i;
            }
        }
        if(s==0)cout << "A ";
        else if(s==1)cout << "B ";
        else if(s==2)cout << "C ";
        else if(s==3)cout << "D ";
        else if(s==4)cout << "E ";
        cout << bm << endl;
    }
        end:;
    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;
			if(max < a+b) {
				max =a+b;
				maxchar=i;
			}
		}
		cout << c[maxchar] << " " << max << endl;
	}
}

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

using namespace std;

int main() {
	string a = "ABCDE";
	int p, q;
	while (cin >> p >> q) {
		if (p == 0 && q == 0) {
			break;
		}
		int max = p+q;
		char maxn = a[0];
		for (int i = 1; i < a.size(); i++) {
			cin >> p >> q;
			if (max < p+q) {
				max = p+q;
				maxn = a[i];
			}
		}
		cout << maxn << " " << max << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#include<map>
#include<stack>
#include<queue>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;

int main(){
    int a, b;
    while(cin >> a >> b, a||b){
        int max = a + b;
        char ans = 'A';
        range(i,1,5){
            cin >> a >> b;
            if(max < a + b){
                ans = 'A' + i;
                max = a + b;
            }
        }
        cout << ans << ' ' << max << endl;
    }
}

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

int main(){
  int s1[5],s2[5];

  while(true){
    cin >> s1[0] >> s2[0];
    if(!s1[0]&&!s2[0]) break;

    int max = s1[0] + s2[0],num = 1;
    for(int i = 1 ; i < 5 ; i++){
      cin >> s1[i] >> s2[i];
      if(max < s1[i]+s2[i]){
	max = s1[i] + s2[i];
	num = i + 1;
      }
    }
    switch(num){
    case 1:
      cout << 'A'; break;
    case 2:
      cout << 'B'; break;
    case 3:
      cout << 'C'; break;
    case 4:
      cout << 'D'; break;
    case 5: 
      cout << 'E'; break;
    }
    cout << ' ' << max << endl;

  }

  return 0;
}

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

C++: 
#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main(void){
while(1){
	int a[9]={0};
	int flg=0;
	int m=0;
	int ed=0;
	for(int i=0;i<5;i++){
        int s;
        cin>>s;
        a[i]+=s;
        cin>>s;
        a[i]+=s;
        if(a[i]==0){
            ed=1;
            break;
        }
        if(a[i]>m)m=a[i],flg=i;

	}
	if(ed==1)break;
	switch(flg){
	case 0:cout<<"A ";break;
	case 1:cout<<"B ";break;
	case 2:cout<<"C ";break;
	case 3:cout<<"D ";break;
	case 4:cout<<"E ";break;

	};
	cout<<m<<endl;


}
	return 0;
}

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

int main(){
	int sm,sn,s[5],i,tmp;
	char a[6]="ABCDE";
	while(cin>>sm>>sn,sm+sn){
		s[0]=sm+sn;
		int ss[5]={};
		for(i=1;i<5;i++){
			cin>>sm>>sn;
			s[i]=sm+sn;
		}
		for(int i=0;i<5;i++){
			for(int j=0;j<5;j++){
				if(i!=j&&s[i]>s[j])ss[i]++;
			}
			if(ss[i]==4)cout<<a[i]<<' '<<s[i]<<endl;
		}
	}
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
#include <queue>
using namespace std;

#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()
const int INF = 1<<30;

int main() {
  int a,b;
  int i = 0;
  int res, ma = 0;
  while(cin>>a>>b,a+b) {
    if (ma < a + b) {
      ma = a + b;
      res = i;
    }
    ++i;
    if (i==5) {
      i = 0;
      printf("%c %d\n", 'A' + res, ma);
    }
  }
}

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

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<map>
using namespace std;
int main(){
  int n,m;
  while(cin>>n>>m,n||m){
    vector<pair<int,char> > shop(5);
    shop[0] = make_pair(n+m,'A');
    cin >>n>>m; shop[1] = make_pair(n+m,'B');
    cin >>n>>m; shop[2] = make_pair(n+m,'C');
    cin >>n>>m; shop[3] = make_pair(n+m,'D');
    cin >>n>>m; shop[4] = make_pair(n+m,'E');
    sort(shop.begin(),shop.end());
    cout <<shop[4].second<<" "<<shop[4].first<<endl;
  }
  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 << endl;
		if(x==1)
			cout << 'B' << ' ' << max << endl;
		if(x==2)
			cout << 'C' << ' ' << max << endl;
		if(x==3)
			cout << 'D' << ' ' << max << endl;
		if(x==4)
			cout << 'E' << ' ' << max << endl;
		}
		return 0;
}