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 <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)) {
                if (i > 4) {
                        printf("%c %d", top_s+'A', max);
                        i = max = 0;
                }
                shop[i] = m+e;
                if (shop[i] > max) {
                        max = shop[i];
                        top_s = i;
                }

                i++;

        }
        return 0;
}

C++: /* 
 * File:   main.cpp
 * Author: freebsd
 *
 * Created on 2014/08/28, 10:07
 */

#include <cstdio>

using namespace std;

int main() {
    while (true) {
        int s1[5] = {0}, s2[5] = {0};
        
        char store[5] = {'A', 'B', 'C', 'D', 'E'};
        
        for(int i = 0; i < 5; i++) {
            scanf("%d %d", &s1[i], &s2[i]);
            if(s1[0] == 0 && s2[0] == 0) return 0;
        }
        
        for(int i = 0; i < 5; i++) {
            s1[i] += s2[i];
        }
        
        int i = 0;
        char tempc;
        int max;
        
        max = s1[0];
        tempc = store[0];
        
        while(i != 4) {
            
            if(max < s1[i + 1]) {
                max = s1[i + 1];
                tempc = store[i + 1];
            }
            i++;
        }
        
        printf("%c %d\n", tempc, max);
    }
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <cmath>
#include <ctime>
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <iterator>
#include <functional>
#include <utility>
#include <algorithm>
#include <numeric>
#include <typeinfo>

using namespace std;

#define dump(n) cout<<"# "<<#n<<"="<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,n) repi(i,0,n)
#define iter(c) __typeof((c).begin())
#define foreach(i,c) for(iter(c) i=(c).begin();i!=(c).end();++i)
#define allof(c) (c).begin(),(c).end()
#define mp make_pair

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;

int main()
{
	for(vi a(5),b(5);cin>>a[0]>>b[0],a[0]|b[0];){
		repi(i,1,5) cin>>a[i]>>b[i];
		rep(i,5) a[i]+=b[i];
		int res=max_element(allof(a))-a.begin();
		cout<<char('A'+res)<<" "<<a[res]<<endl;
	}
	
	return 0;
}

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

using namespace std;

int main(){
  int s1,s2;
  vector<pair<string,int>> conclusion;

  while(1){
    pair<string,int> result;
    cin>>s1>>s2;
    if(s1==0 && s2==0) break;
    result.first="A";
    result.second=s1+s2;

    cin>>s1>>s2;
    if(s1==0 && s2==0) break;
    if(s1+s2>result.second){
      result.first="B";
      result.second=s1+s2;
    }

    cin>>s1>>s2;
    if(s1==0 && s2==0) break;
    if(s1+s2>result.second){
      result.first="C";
      result.second=s1+s2;
    }

    cin>>s1>>s2;
    if(s1==0 && s2==0) break;
    if(s1+s2>result.second){
      result.first="D";
      result.second=s1+s2;
    }

    cin>>s1>>s2;
    if(s1==0 && s2==0) break;
    if(s1+s2>result.second){
      result.first="E";
      result.second=s1+s2;
    }

    conclusion.push_back(result);

  }

  for(auto i:conclusion)
    cout<<i.first<<" "<<i.second<<endl;
}

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;
		cin >> a >> b;
		if(a == 0  && b == 0) break;
		for(int i=0;i<5;i++){
			if(max < a+b) {
				max =a+b;
				maxchar=i;
			}
		}
		cout << c[maxchar] << " " << max << endl;
	}
}

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

int main(){
	int a[5],b[5];
	while(cin >> a[0] >> b[0] && (a[0]||b[0])){
		int best = 0;
		for(int i = 1 ; i <= 4 ; i++){
			cin >> a[i] >> b[i];
			if( a[i]+b[i] >= a[best] + b[best] ){
				best = i;
			}
		}
		cout << (char)('A'+best) << " "<< a[best]+b[best] << endl;
		
	}
}

C++: #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cassert>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
typedef long long ll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
int main()
{
	while(1)
	{
		int x[5],y[5];
		cin >> x[0] >> y[0];
		if(x[0]+y[0] == 0) return 0;
		for(int i=1;i<5;i++) cin >> x[i] >> y[i];
		for(int i=0;i<5;i++)
		{
			for(int j=0;j<5;j++)
			{
				if(i == j) continue;
				if(x[i]+y[i] < x[j]+y[j])
				{
					goto out;
				}
			}
			cout << (char)('A'+i) << " " << x[i]+y[i] << endl;
			out:;
		}
	}
}

C++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
void solve();
main { solve(); return 0; }
// clang-format on

void solve() {
  vi p(5), q(5);
  while (cin >> p[0] >> q[0], p[0]) {
    loop(i, 1, 5) cin >> p[i] >> q[i];
    vector<pair<int, string>> v(5);
    rep(i, 5) v[i] = mp(p[i] + q[i], 'A' + i);
    sort(all(v));
    cout << v.back().se << ' ' << v.back().fi << endl;
  }
}

C++: #include <iostream>
using namespace std;
int main(){
	int max=0;
	char lb='A';
	for(int i=0,s1,s2;i<5;++i){
		cin>>s1>>s2;
		if(s1==0&&s2==0) break;
		if(s1+s2>max){
			max=s1+s2;
			lb='A'+i;
		}
		if(i==4){
			cout<<lb<<" "<<max<<"\n";
			max=0;
			i=-1;
			lb='A';
		}
	}
	return 0;
}

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