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>
#include<algorithm>
#include<string>
using namespace std;

int main() {
	int a[5] = {};
	int aa[5] = {};
	string s[5] = { "A","B","C","D","E" };
	int b, c;
	while (cin >> b >> c, b, c) {
		int d, e;
		a[0] = b + c;
		aa[0] = a[0];
		for (int i = 0; i < 4; i++) {
			cin >> d >> e;
			a[i + 1] = d + e;
			aa[i + 1] = a[i + 1];
		}
		sort(aa, aa + 5);

		for (int i = 0; i < 5; i++) {
			if (a[i] == aa[4]) {
				cout << s[i] << endl;
				break;
			}
		}

	}
	return 0;
}

C++: #include <cstdio>
#include <map>
#include <string>
#include <algorithm>
using namespace std;
int main() {
    auto cmp = [](const pair<int, int> &a, const pair<int, int> &b) { return a.second > b.second; };
    int s1, s2;
    pair<int, int> ds[5];
    string str = "ABCDE";

    for (;;) {
        scanf("%d %d", &s1, &s2);
        if (s1 == 0 && s2 == 0) break;
        for (int i = 0; i < 5; i++) ds[i] = {i, 0};
        ds[0].second = s1+s2;
        for (int i = 1; i < 5; i++) { scanf("%d %d", &s1, &s2); ds[i].second = s1+s2; }
        sort(ds, ds+5, cmp);
        printf("%c %d\n", str[ds[0].first], ds[0].second);
    }

    return 0;
}

C++: #include <cstdio>

int main(){
	char cs[]="ABCDE";
	for(;;){
		int a,b;
		scanf("%d%d",&a,&b);
		if(a==0&&b==0) break;
		int ma=a+b;
		char c='A';
		for(int i=0;i<4;i++){
			scanf("%d%d",&a,&b);
			if(a+b>ma){
				ma=a+b;
				c=cs[i+1];
			}
		}
		printf("%c %d\n",c,ma);
	}
}

C++: #include <iostream>

using namespace std;


int main() {

  int s1,s2;

  int max,max_id;


  while(cin >> s1 >> s2) {

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

    max=s1+s2;
    
    max_id=0;

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

      cin >> s1 >> s2;

      if(max<s1+s2) {

	max=s1+s2;

	max_id=i;

      }

    }

    cout << (char)('A'+max_id) << " " << max << endl;

  }

  return 0;

}

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


int main()
{
  vector< int > sum(5);

  while(true) {
    for(int i = 0; i < 5; i++) {
      int s1, s2;
      if(cin >> s1 >> s2) {
        sum[i] = s1 + s2;
      } else {
        return(0);
      }
    }
    cout << (char)(max_element(sum.begin(), sum.end()) - sum.begin() + 'A') << " " << *max_element(sum.begin(), sum.end()) << endl;
  }
}

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

int sum[5];
int sum2[5];
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int a, b;
    while(cin >> a >> b && (a || b)){
        sum[0] = a + b;
        sum2[0] = sum[0];
        for(int i = 1; i < 5; ++i){
            int s1, s2;
            cin >> s1 >> s2;
            sum[i] = s1 + s2;
            sum2[i] = sum[i];
        }

        sort(sum, sum + 5);

        for(int i = 0; i < 5; ++i){
            if(sum2[i] == sum[4]){
                cout << char('A' + i) << " " << sum[4] << endl;
            }
        }
    }

    return 0;
}

C++: #include <iostream>
using namespace std;
 
int main(){
int gozen,gogo,total,shop;
        while(gozen!=0||gogo!=0){
        	total=0;
        	cin>>gozen>>gogo;
        	if(gozen+gogo==0)break;
        	if(total<gozen+gogo){
        		total=gozen+gogo;
        		shop=0;
        	}
        for(int i=1;i<5;i++){
                cin>>gozen>>gogo;
        	if(total<gozen+gogo){
        		total=gozen+gogo;
        		shop=i;
        	}
        }
        	if(shop==0)cout<<"A "<<total<<endl;
        	else if(shop==1)cout<<"B "<<total<<endl;
        	else if(shop==2)cout<<"C "<<total<<endl;
        	else if(shop==3)cout<<"D "<<total<<endl;
        	else cout<<"E "<<total<<endl;
        }
}

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

//define
#define int long long
#define UNIQUE(v) v.erase(unique(all(v)), v.end());
#define ZIP(v) sort(all(v)),UNIQUE(v)
#define ADD(a, b) a = (a + b) % mod
#define SUB(a, b) a = (a+mod-b)%mod
#define MUL(a, b) a = (a * b) % mod
#define repi(i,m,n) for(int i = m;i < n;i++)
#define drep(i,n,m) for(int i = n;i >= m;i--)
#define rep(i,n) repi(i,0,n)
#define rrep(i,n) repi(i,1,n+1)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(), v.rend()
#define dmp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define fi first
#define se second

//template
template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &p){
  os << p.first << " " << p.second;return os;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v){
  for (auto it = v.begin();it != v.end();++it){
    if (it != v.begin())os << " ";os << *it;
  }return os;
}
template<typename T, int SIZE>
int array_length(const T (&)[SIZE]){return SIZE;}
template<typename T, int N>
void print(const T (&a)[N], int s = N, int t = -1, bool f = true){
	if(t == -1){rep(i,s){if(i)cout << " ";cout << a[i];}}
	else repi(i,s,t){if(i!=s)cout << " ";cout << a[i];}
	if(f)cout << "\n";
}
template<typename T, int N1, int N2>
void print(const T (&a)[N1][N2], int h = N1, int w = N2){
	rep(i,h){rep(j,w){cout << a[i][j] << " \n"[j==w-1];}}
}

//typedef
typedef pair<int,int> P;
typedef pair<int, P> PP;
typedef pair<P, int> Pi;
typedef vector<int> vi;
typedef deque<int> dq;
const int inf = 1e9+7;
const int INF = 1e18+7;

int a[10], b[10];
signed main(){
	while(1){
		int x, y;
		scanf("%lld%lld", &x, &y);
		if(x == 0 and y == 0)break;
		a[0] = x;b[0] = y;
		rep(i,4)scanf("%lld%lld", &a[i+1], &b[i+1]);
		rep(i,5)a[i] += b[i];
		int mx = *max_element(a, a+5);
		rep(i,5)if(a[i] == mx)printf("%c %lld\n", "ABCDE"[i], a[i]);
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int s,a,b,c;
    while(cin>>a>>b,a){
        s=a+b; c=0;
        for(int i=1; i<5; i++){
            cin>>a>>b;
            if(s<a+b)
            s=a+b,c=i;
        }
        cout<<(char)(c+'A')<<' '<<s<<endl;
    }
}

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

int main() {
	int i,a,b,c,s,k;
	while(true) {
		for (i=s=c=0;i<5;i++) {
			cin >> a >> b; k=a+b; if (k==0) break;
			if (k>s) { s=k; c=i;}
		}
		if (k==0) break;
		cout << (char)('A'+c) <<  ' ' <<  s << endl;
	}
	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",p-a+'A',*p);
	}
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
	int best,set,s1,s2;
	bool t=true;
	while(true){
	best=0;
	for(int i=0;i<5;i++){
		cin>>s1>>s2;
		if(s1==0&&s2==0){
			t=false;
			break;
		}
		if(best<s1+s2){
			set=i;
			best=s1+s2;
		}
	}
	if(t==false)
		break;
	char z='A'+set;
	cout<<z<<" "<<best<<endl;
	}
    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<bits/stdc++.h>
using namespace std;
int main() {
  int s1, s2;
  while( cin >> s1 >> s2, s1+s2 ) {
    int maxn = s1 + s1;
    char maxi = 'A';
    for(int i=1; i<5; i++) {
      cin >> s1 >> s2;
      if( maxn < s1 + s2 ) {
	maxn = s1 + s2;
	maxi = 'A' + i;
      }
    }

    cout << maxi << ' ' << maxn << endl;
  }
}