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 <bits/stdc++.h>

using namespace std;
using ll = long long;
using pii = pair<int, int>;

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  int a, b;
  while (cin >> a >> b, a) {
    int cnt[5] = {};
    cnt[0] = a + b;
    for (int i = 1; i < 5; i++) {
      cin >> a >> b;
      cnt[i] = a + b;
    }
    auto p = max_element(cnt, cnt + 5);
    cout << char('A' + (p - cnt)) << " " << *p << endl;
  }

  return 0;
}

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

using namespace std;

typedef pair<int, char> P;

int main()
{
    int s1, s2;
    vector<P> shop(5);
    while(cin >> s1 >> s2 && s1 && s2) {
        shop[0] = P(s1 + s2, 'A');
        for(int i = 1; i < 5; i ++) {
            cin >> s1 >> s2;
            shop[i] = P(s1 + s2, 'A' + i);
        }

        sort(shop.begin(), shop.end());
        cout << shop[4].second << " " << shop[4].first << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
	int best,set,s1,s2;
	while(true){
	best=0;
	for(int i=0;i<5;i++){
		cin>>s1>>s2;
		if(s1==0&&s2==0)
			break;
		if(best<s1+s2){
			set=i;
			best=s1+s2;
		}
	}
	char z='A'+set;
	cout<<z<<" "<<best<<endl;
	}
    return 0;
}

C++: #include<iostream>
#include<cstring>
#include<algorithm>
#include<vector>
#include<cstdio>
#include<cmath>
#define pb(in,tmp) in.push_back(tmp)
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,b) loop(i,0,b)
#define all(in) in.begin(),in.end()
using namespace std;
int main(){
int a[5];
char b[5]={'A','B','C','D','E'};
int c,d;
while(cin>>c>>d,c||d){
a[0]=c+d;
loop(i,1,5){
cin>>c>>d;
a[i]=c+d;
}
int max=0;
int mai;
rep(i,5){
if(max<a[i]){
max=a[i];
mai=i;
}
}
cout<<b[mai]<<" "<<max<<endl;
}
}

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

C++: #include <iostream>

#define rep(i,n) for(int i=0;i<(int)(n);i++)
const int INF = 10000000;
using namespace std;
typedef long long  ll;
/** Problem0195 : What is the Most Popular Shop in Tokaichi? **/
int main()
{
	string list = "ABCDE";
	int s1, s2, max=0, i=0;
	char maxN;
	while (1) {
		cin >> s1 >> s2;
		if (s1 == 0 && s2 == 0)
			break;
		
		if (max < s1+s2) {
			max = s1 + s2;
			maxN = list[i%5];
		}
		
		if (i%5==4) {
			cout << maxN << " " << max << endl;
			max = 0;
		}
		i++;
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<stdio.h>
#include<cstdio>
#include<math.h>
using namespace std;
int main(){
    int a1,a2,b1,b2,c1,c2,d1,d2,e1,e2,max=-10000;
    int sum[100];
    char ch;
    while(1){
        cin>>a1>>a2;
        if(a1==0 && a2==0){
            break;
        }
        cin>>b1>>b2>>c1>>c2>>d1>>d2>>e1>>e2;
        sum[0]=a1+a2;sum[1]=b1+b2;sum[2]=c1+c2;sum[3]=d1+d2;sum[4]=e1+e2;
        for(int i=0;i<5;i++){
            if(sum[i]>max){
                   max=sum[i];
                ch='A'+i;
            }
        }
        cout<<ch<<" "<<max<<endl;
        max=-10000;
    }
    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 <iostream>
using namespace std;

int main()
{	
	int a[5], b[5], k = 0;
	char s[6] = "ABCDE";

	cin >> a[0] >> b[0];
	int m = a[0] + b[0];

	while (m > 0) {

		for (int i = 1; i < 5; i++) {
			cin >> a[i] >> b[i];

			if (a[i] + b[i] > m) {
				k = i;
				m = a[i] + b[i];
			}
		}

		cout << s[k] << " " << m << endl;

		cin >> a[0] >> b[0];
		m = a[0] + b[0];
		k = 0;
	}
	
	return 0;
}

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

int main(){
  string shop[5]={"A","B","C","D","E"};
  string ans_char;
  int mo,af,ans_int;
  while(1){
    cin >> mo >> af;
    if(mo == 0 && af == 0) break;
    ans_int = mo + af;
    ans_char = shop[0];
    for(int i=1;i<=4;i++){
      cin >> mo >> af;
      if(ans_int < mo + af){
	ans_int = mo + af;
	ans_char = shop[i];
      }
    }
    cout << ans_char << " " << ans_int << endl;
  }
}

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

using namespace std;

struct Shop {
	char name;
	int sell[2];
	int total;
};

bool compare(Shop i, Shop j) {
	return (i.total < j.total);
}

int main() {
	
	Shop shop[5];
	bool test = false;

	while (true) {

		shop[0].name = 'A';
		for (int i = 0; i < 5; i++) {
			cin >> shop[i].sell[0] >> shop[i].sell[1];
			if (shop[0].sell[0] == 0 && shop[0].sell[1] == 0 && i == 0) {
				test = true;
				break;
			}
			shop[i].total = shop[i].sell[0] + shop[i].sell[1];
			shop[i].name = 'A' + i;

		}
		if (test)
			break;
		sort(shop, shop + 5, compare);
		cout << shop[4].name << " " << shop[4].total << "\n";

	}
	
	return 0;

}

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

int main()
{
    int A[5], B[5];

    while ( cin >> A[0] >> B[0], A[0] || B[0] ) {
        int maxp = 0;
        for ( int i = 1; i < 5; i++ ) {
            cin >> A[i] >> B[i];
            if ( A[maxp] + B[maxp] < A[i] + B[i] ) {
                maxp = i;
            }
        }
        cout << (char)('A' + maxp) << " " << A[maxp] + B[maxp] << endl;
    }

    return ( 0 );
}

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

C++: #include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
int main(){
  while(true){
    vector<int>shop(5);
    rep(i,5){
      int a,b;
      cin >> a >> b;
      if(a == 0 && b == 0){
        return 0;
      }
      shop[i] = a + b;
    }
    int Max = 0;
    rep(i,5)Max = max(shop[i],Max);
    rep(i,5){
      if(Max == shop[i]){
        cout << (char)('A' + i) << " " << shop[i] << endl;
        break;
      }
    }
  }
  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main() {
  int s1, s2;
  while( cin >> s1 >> s2, s1+s2 ) {
    int maxn = s1 + s1;
    int maxi = 0;
    for(int i=1; i<5; i++) {
      cin >> s1 >> s2;
      if( maxn < s1 + s2 ) {
	maxn = s1 + s2;
	maxi = i;
      }
    }

    cout << (char)('A'+maxi) << ' ' << maxn << endl;
  }
}

C++: #include<stdio.h>
#include<algorithm>

using namespace std;

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

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