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<cstdio>
#include<cstring>
#include<algorithm>
#include<functional>
using namespace std;
int main(void)
{
	int i,j,max=-1,x,flg=0;
	char mise[6]={'A','B','C','D','E'};
	int s1[6],s2[6],sum[6];
	while(1) {
		scanf("%d %d",&s1[0],&s2[0]);
		if(s1[0]==0 && s2[0]==0) {
			break;
		}
		sum[0]=s1[0]+s2[0];
		max=sum[0];
		x=0;
		for(i=1;i<5;i++) {
			scanf("%d %d",&s1[i],&s2[i]);
			sum[i]=s1[i]+s2[i];
			if(max<sum[i]) {
				x=i;
				max=sum[i];
			}
		}
		printf("%c %d\n",mise[x],sum[x]);
		flg=0;
	}
	return 0;
}

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

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

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
int main(){
	int a,b;
	char mise[4]={'B','C','D','E'};
	while(cin>>a>>b){
		vector<pair<int,char> > data;
		if(a==0&&b==0)break;
		data.push_back(make_pair(a+b,'A'));
		for(int i=0;i<4;i++){
			cin>>a>>b;
			data.push_back(make_pair(a+b,mise[i]));
		}
		sort(data.begin(),data.end());
		cout<<data[4].second<<" "<<data[4].first<<endl;
	}
			
}

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){
		scanf("%d%d",&s1[0],&s2[0]);
		if(s1[0]==0&&s2[0]==0){
			break;
		}
		for(i=1;i<5;i++){
			scanf("%d%d",&s1[i],&s2[i]);
		}
		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;
}

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

int solve_testcase() {
  vector<int> s1(5), s2(5);
  cin >> s1[0] >> s2[0];
  if(s1[0] == 0 and s2[0] == 0) return 1;
  for(int i=1; i<5; i++) {
    cin >> s1[i] >> s2[i];
  }

  char c[] = {'A', 'B', 'C', 'D', 'E'};
  int max_val = 0, arg = -1;
  for(int i=0; i<5; i++) {
    if(s1[i] + s2[i] > max_val) {
      max_val = s1[i] + s2[i];
      arg = i;
    }
  }
  cout << c[arg] << " " << max_val << endl;
  return 0;
}

int main() {
  while(!solve_testcase());
  return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

int main()
{
//	cut here before submit 
//	freopen("testcase.tokaichi", "r", stdin);
	string str = "";
	map <int, char, greater<int> > shop;

	int i = 0;
	while (getline (cin, str ) ){
		char name = 'A' + i;
		int s1, s2;
		stringstream ss(str);
		ss >> s1 >> s2;

		if (s1 == 0 && s2 == 0){
			break;
		} // end if
		shop.insert (make_pair (s1+s2, name ) );
		++i;
		if (i < 5) {
			continue;
		} // end if

		map<int, char, greater<int> >::iterator it = shop.begin();
		cout << (*it).second << ' ' << (*it).first << endl;

		i = 0;
		shop.clear();
	} // end while
		
	return 0;
}

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

int main() {
	int mor, aft;
	while(1){
		vector<int> num;
		for(int i = 0; i < 5; i++){
			cin >> mor >> aft;
			if(mor == 0 && aft == 0)goto finished;
			num.push_back(mor + aft);
		}
	
		int ans = 0;
		char shop;
		for(int i = 0; i < 5; i++){
			if(ans < num[i]){
				ans = num[i];
				shop = 'A' + i;
			}
		}
	
		cout << shop << " " << ans << endl;
	}
	finished:
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
   int s1[5], s2[5];

   while(true){
       for(int i = 0; i < 5; i++){
           cin >> s1[i] >> s2[i];
           if(s1[0] == 0 && s2[0] == 0) return 0;
       }

       int sum[5];
       int max = 0; 
       char n[5] = {'A', 'B', 'C', 'D', 'E'};
       int p;

       for(int i = 0; i < 5; i++){
           sum[i] = s1[i] + s2[i];
           if(sum[i] > max){
               max = sum[i];
               p = i;
           }
       }
       cout << n[p] << " " << max << endl;
   }
}

C++: #include<iostream>
using namespace std;
int main(){
	int sum[5];
	int s1,s2;
	while(cin >> s1 >> s2){
		if(s1==0 && s2==0) break;
		sum[0]=s1+s2;
		for(int i=1; i<5; i++){
			cin >> s1 >> s2;
			sum[i]=s1+s2;
		}
		int max=sum[0];
		char flag = 'A';
		for(int i=1; i<5; i++){
			if(sum[i] > max){
				max = sum[i];
				flag='A'+i;
			}
		}
		cout << flag << " ";
		cout << max << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<algorithm>
#include<array>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<unordered_map>
#include<queue>
#include<vector>
using namespace std;

//#define int long long
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define dump(o) {cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) {cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
const int MOD = 1e9 + 7;
string s = "ABCDE";
signed main() {
	int s1[5], s2[5], sum[5];
	for (; cin >> s1[0] >> s2[0] && s1[0];) {
		rep(i, 1, 5)cin >> s1[i] >> s2[i];
		rep(i, 0, 5)sum[i] = s1[i] + s2[i];
		cout << s[max_element(sum, sum + 5) - sum] << " " << *max_element(sum, sum + 5) << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <math.h>
#include <cmath>
#include <stdio.h>
#include <string>
#include <string.h>
#include <cstring>
#include <sstream>
#include <iomanip>
#include <stdlib.h>

using namespace std;

int main (void)
{
	for (int u = 0; u < 100; u++)
	{
		int a[5],b[5];
		int p = 0;

		for (int i = 0; i < 5; i++)
		{
			cin >> a[i] >> b[i];
			if (a[i] == 0 && b[i] == 0)
			{
				p++;
				break;
			}
		}
		if (p != 0)
		{
			break;
		}

		int gg = 0,ggg = 0;
		for (int i = 0; i < 5; i++)
		{
			if (a[i] + b[i] > gg)
			{
				gg = 0;
				gg = a[i] + b[i];
				ggg = 0;
				ggg = i;
			}
		}


		if (ggg == 0)
		{
			cout << 'A';
		}
		else if (ggg == 1)
		{
			cout << 'B';
		}
		else if (ggg == 2)
		{
			cout << 'C';
		}
		else if (ggg == 3)
		{
			cout << 'D';
		}
		else if (ggg == 4)
		{
			cout << 'E';
		}
		cout << " " << gg << endl;
	}
}

C++: #include<stdio.h>
int main(void)
{
	int x,y,i,max,j;
	int s1[6],s2[6];
	char omise[5]={'A','B','C','D','E'};
	max=-1;
	j=0;
	scanf("%d %d",&s1[0],&s2[0]);
	if(s1[0]==0 && s2[0]==0){}
	else{
		for(i=1;i<5;i++){
				scanf("%d %d",&s1[i],&s2[i]);
			}
		while(!(s1[0]==0 && s2[0]==0)){
			
			for(i=0;i<5;i++){
				x=s1[i]+s2[i];
				if(max<x){
					max=x;
					if(i>0){
						j++;
					}
				}
			}
			printf("%c %d\n",omise[j],max);
			j=0;
			for(i=0;i<5;i++){
				s1[i]=0;
				s2[i]=0;
			}
			scanf("%d %d",&s1[0],&s2[0]);
			if(s1[0]==0&& s2[0]==0){
				break;
			}
			for(i=1;i<5;i++){
				scanf("%d %d",&s1[i],&s2[i]);
			}
		}
	}
	return 0;
}