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++: //四則演算 #pragma GCC target("avx")
//並列計算 #pragma GCC optimize("O3")
//条件分岐を減らす #pragma GCC optimize("unroll-loops")
//浮動小数点演算 #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using VI = vector<int>;
using VL = vector<ll>;
using VS = vector<string>;
template<class T> using PQ = priority_queue<T, vector<T>, greater<T>>;
#define FOR(i,a,n) for(int i=(a);i<(n);++i)
#define eFOR(i,a,n) for(int i=(a);i<=(n);++i)
#define rFOR(i,a,n) for(int i=(n)-1;i>=(a);--i)
#define erFOR(i,a,n) for(int i=(n);i>=(a);--i)
#define each(i, a) for(auto &i : a)
#define SORT(i) sort(i.begin(),i.end())
#define rSORT(i) sort(i.rbegin(),i.rend())
#define fSORT(i,a) sort(i.begin(),i.end(),a)
#define all(i) i.begin(),i.end()
#define out(y,x) ((y)<0||h<=(y)||(x)<0||w<=(x))
#define line cout << "-----------------------------\n" 
#define ENDL(i,n) ((i) == (n) - 1 ? "\n" : " ")
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
constexpr ld eps = 1e-10;
constexpr ld pi = 3.1415926535897932;
template<class T>inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; }return false; }
template<class T>inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; }return false; }
inline void init() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }
template<class T>inline istream& operator>>(istream& is, vector<T>& v) { for (auto& a : v)is >> a; return is; }
template<class T>inline istream& operator>>(istream& is, deque<T>& v) { for (auto& a : v)is >> a; return is; }
template<class T, class U>inline istream& operator>>(istream& is, pair<T, U>& p) { is >> p.first >> p.second; return is; }
template<class T>inline vector<T> vec(size_t a) { return vector<T>(a); }
template<class T>inline vector<T> defvec(T def, size_t a) { return vector<T>(a, def); }
template<class T, class... Ts>inline auto vec(size_t a, Ts... ts) { return vector<decltype(vec<T>(ts...))>(a, vec<T>(ts...)); }
template<class T, class... Ts>inline auto defvec(T def, size_t a, Ts... ts) { return vector<decltype(defvec<T>(def, ts...))>(a, defvec<T>(def, ts...)); }
inline void print() { cout << "\n"; }
template<class T, class... Ts>inline void print(const T& a, const Ts&... ts) { cout << a << " "; print(ts...); }
template<class T>inline void print(const vector<T>& v) { for (int i = 0; i < v.size(); ++i)cout << v[i] << (i == v.size() - 1 ? "\n" : " "); }
template<class T>inline void print(const vector<vector<T>>& v) { for (auto& a : v)print(a); }
inline string reversed(const string& s) { string t = s; reverse(all(t)); return t; }

void solve(int num, int val) {
    FOR(i, 1, 5) {
        int s1, s2; cin >> s1 >> s2;
        if (chmax(val, s1 + s2))num = i;
    }
    cout << char('A' + num) << " " << val << "\n";
}

int main() {
    init();

    for (int s1, s2; cin >> s1 >> s2 && s1 != 0;)solve(0, s1 + s2);

    return 0;
}

C++: #include<vector>
#include<list>
#include<algorithm>
#include<iostream>
#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
  int i;
  int z,g,m,b;
  for(;;){
    cin>>z>>g;
    if(z+g==0)
      break;
    m=z+g;
    b=0;
    for(i=1;i<5;i++){
      cin>>z>>g;
      if(z+g>m){
	m=z+g;
	b=i;
      }
    }
    cout<<(char)('A'+b)<<" "<<m<<endl;
  }
  return 0;
}

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

int main(){
  pair<int,char>shop[5];
  int am[5],pm[5];

  while(1){
    cin >> am[0] >> pm[0];
    if(am[0] == 0 && pm[0] == 0)break;

    for(int i=1;i<5;i++){
      cin >> am[i] >> pm[i];
    }
    
    for(int i=0;i<5;i++){
      shop[i].first = am[i] + pm[i];
      shop[i].second = 'A' + i;
    }
  
    sort(shop,shop+5);

    cout << shop[4].second << ' ' << shop[4].first << endl;
  }
  return 0;
}

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

C++: // Tazoe

#include <iostream>
using namespace std;

int main()
{
	while(true){
		int s1, s2;
		cin >> s1 >> s2;

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

		char n_max = 'A';
		int s_max = s1+s2;

		cin >> s1 >> s2;
		if(s1+s2>s_max){
			n_max = 'B';
			s_max = s1+s2;
		}

		cin >> s1 >> s2;
		if(s1+s2>s_max){
			n_max = 'C';
			s_max = s1+s2;
		}

		cin >> s1 >> s2;
		if(s1+s2>s_max){
			n_max = 'D';
			s_max = s1+s2;
		}

		cin >> s1 >> s2;
		if(s1+s2>s_max){
			n_max = 'E';
			s_max = s1+s2;
		}

		cout << n_max << ' ' << s_max << '\n';
	}

	return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007
#define EPS 1e-10

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;

char c[] = "BCDE", ans;
int a, b;

int main(){
	while (cin >> a >> b&&a + b){
		ans = 'A';
		int sum = a + b;
		REP(i, 4){
			cin >> a >> b;
			if (sum < a + b){
				ans = c[i];
				sum = a + b;
			}
		}
		cout << ans << " " << sum << endl;
	}

}

C++: #include <iostream>
#include <cstdio>
using namespace std;
int main(void) {
  int s1[5], s2[5], total[5], max, shop;
  
  while(1) {
    max = 0;
    cin >> s1[0] >> s2[0];
    total[0] = s1[0] + s2[0];
    if(s1[0] == 0 && s2[0] == 0) break;
    for(int i = 1 ; i < 5 ; i++) {
      cin >> s1[i] >> s2[i];
      total[i] = s1[i] + s2[i];
    }
    
    for(int i = 0 ; i < 5 ; i++) {
      if(total[i] > max) { max = total[i]; shop = i; }
    }

    if(shop == 0) cout << 'A' << ' ' << total[0] << endl;
    if(shop == 1) cout << 'B' << ' ' << total[1] << endl;
    if(shop == 2) cout << 'C' << ' ' << total[2] << endl;
    if(shop == 3) cout << 'D' << ' ' << total[3] << endl;
    if(shop == 4) cout << 'E' << ' ' << total[4] << endl;
  }
  return 0;
}

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

using namespace std;

int main(){
    while(true){
        vector<int> vals(5,0);
        bool valid=true;
        for(int i=0;i<5;i++){
            cin>>vals[i];
            int v=0;
            cin>>v;
            vals[i]+=v;
            if(vals[i]==0){
                valid=false;
                break;
            }
        }
        if(!valid)break;

        int max_i=0;
        for(int i=1;i<5;i++){
            if(vals[i]>vals[max_i])max_i=i;
        }

        cout<<(char)(max_i+'A')<<" "<<vals[max_i]<<endl;
    }
}