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 <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<long long> vll;
typedef pair<int,int> pint;
typedef pair<long long, long long> pll;

#define MP make_pair
#define PB push_back
#define ALL(s) (s).begin(),(s).end()
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P) 
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P) 
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P) 
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P) 
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s; }


int a, b;
int main() {
	while (cin >> a >> b) {
		if (a == 0 && b == 0) break;
		int res = a+b, ind = 0;
		for (int id = 1; id < 5; ++id) {
			cin >> a >> b;
			if (chmax(res, a+b)) ind = id;
		}
		cout << (char)('A'+ind) << " " << res << 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 <iostream>
#include <string>
using namespace std;
int GetMaxs(int date[], int n){
	int max=0, maxn=0;
	for(int i=0; i<n; i++){
		if(max<date[i]){
			max = date[i];
			maxn = i;
		}
	}
	return (maxn);
}

int main(void){
	int m[5],am,pm;
	string s;
	while(cin>>am>>pm,am){
		m[0] = am + pm;
		for(int i=1; i<5; i++){
			cin>>am>>pm;
			m[i] = am + pm;
		}
		s = 'A' + GetMaxs(m,5);
		cout << s << " " << m[GetMaxs(m,5)] <<endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>

#define rep_(v, f, l) for (int v = (f), v##_ = (l); v < v##_; ++v)
#define rep(v, n) rep_(v, 0, n)
#define lep(v, n) rep_(v, 1, n + 1)
#define rrep_(v, f, l) for (int v = (l), v##_ = (f); v >= v##_; --v)
#define rrep(v, n) rrep_(v, 0, n - 1)
#define rlep(v, n) rrep_(v, 1, n)
#define show_a(a, size) rep(a##_it, size) std::cout << a[a##_it] << " \n"[a##_it == a##_it_ - 1];
#define show_v(v) show_a(v, v.size())
#define eachv(v, i) rep(i, v.size())
#define reachv(v, i) rrep(i, v.size())
#define debug(x) std::cerr << #x << " = " << x << "\n";

using namespace std;

typedef long long int lint;

static inline int in(){ int x; scanf("%d", &x); return x; }
static inline lint inl(){ lint x; scanf("%lld", &x); return x; }

int main()
{
    int a;
    while (a = in() + in()){
        vector<pair<int, char> > stores;
        stores.push_back(make_pair(a, 'A'));
        rep(i, 4){
            stores.push_back(make_pair(in() + in(), 'B' + i));
        }
        sort(stores.begin(), stores.end(), greater<pair<int, char> >());
        printf("%c %d\n", stores[0].second, stores[0].first);
    }
    return (0);
}

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

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;

const int mod = 1000000007;
constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int a,b;
  while(cin >> a >> b && a && b){
    vary(int,v,5,0);
    v[0] += a+b;
    REP(i,1,5){
      cin >> a >> b;
      v[i] += a+b;
    }
    cout << char(distance(v.begin(),max_element(all(v))) + 'A') << " " << *max_element(all(v))<<endl;
  }
  return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<stdio.h>
using namespace std;
int main(){
    int a[100],b[100],c[100],d[100],e[100],A,B,C,D,E,am=0,bm=0,cm=0,dm=0,em=0,i,j,max;
    char x;
    am=a[0];bm=b[0];cm=c[0];dm=b[0];em=e[0];
    for(i=1;i<100;i++){
        
        for(A=0;A<2;A++){
            cin>>a[A];
            am+=a[A];
            if(a[A]==0){
                break;
            }
        }
        if(a[A]==0){
            break;
        }
        for(B=0;B<2;B++){
            cin>>b[B];
            bm+=b[B];
            if(b[B]==0){
                break;
            }
        }
        if(b[B]==0){
             break;
        }
        for(C=0;C<2;C++){
            cin>>c[C];
            cm+=c[C];
            if(c[C]==0){
                break;
            }
        }
        if(c[C]==0){
            break;
        }
        for(D=0;D<2;D++){
            cin>>d[D];
            dm+=d[D];
            if(d[D]==0){
                break;
            }
        }
        if(d[D]==0){
            break;
        }
        for(E=0;E<2;E++){
            cin>>e[E];
            em+=e[E];
            if(e[E]==0){
                break;
            }
        }
        if(e[E]==0){
            break;
        }
        
        if(am<bm){
            max=bm;
            x='B';
        }else{
            max=am;
            x='A';
        }
        if(max<cm){
            max=cm;
            x='C';
        }
        if(max<dm){
            max=dm;
            x='D';
        }
        if(max<em){
            max=em;
            x='E';
        }
        cout<<x<<" "<<max<<endl;
        max=0;
        am=0;bm=0;cm=0;dm=0;em=0;
    }
    return 0;
}