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++: #define _CRT_SECURE_NO_WARNINGS
#include<cstdio>
#include<cmath>
#include<sstream>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<utility>
#include<iomanip>
#include<vector>
#include<string>
#include<queue>
#include<stack>
#include<map>
#include<list>
#include<set>
#include<stdlib.h>
#include<time.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define repp(i,k,n) for(int i=k;i<(int)n;i++)
using namespace std;
const int dx[4] = { 0, 1, 0, -1 }, dy[4] = { 1, 0, -1, 0 };
const int dX[8] = { 0, 1, 1, 1, 0, -1, -1, -1 }, dY[8] = { 1, 1, 0, -1, -1, -1, 0, 1 };
struct XY
{
	int x;
	int y;
};
vector<long long> Prime;
void SieveOfEratosthenes(long long e) //setup vector<long long>Prime(~x)
{
	bool *x=new bool[e];
	for (long long i = 0; i <= e; i++)x[i] = false;
	for (long long i = 2; i <= e; i++)
	{
		if (x[i]);
		else
		{
			Prime.push_back(i);
			for (long long l = i; l <= e; l += i)x[l] = true;
		}
	}
	return;
}
int StringToInt(string a)
{
	stringstream ss;
	int x;
	ss << a;
	ss >> x;
	return x;
}
string IntToString(int a)
{
	stringstream ss;
	string x;
	ss << a;
	ss >> x;
	return x;
}
int GetRandom(int MIN, int MAX)
{
	static int flag=0;
	if (flag == 0)
	{
		srand((unsigned int)time(NULL));
		flag = 1;
	}
	return MIN + (int)(rand()*(MAX - MIN + 1.0) / (1.0 + RAND_MAX));
}
int in()
{
	int x;
	cin >> x;
	return x;
}
void outl(string a)
{
	cout << a << endl;
	return;
}
void outl(int a)
{
	cout << a << endl;
	return;
}
void out(string a)
{
	cout << a;
	return;
}
void out(int a)
{
	cout << a;
	return;
}
/*
(char)'1' - (int)48 = (int)1;
???1111181
 (char)A=(int)65
 (char)a=(int)97
*/
////////////////////////////////////////////////////

int main()
{
	while (1)
	{
		vector<pair<int, string > > a;
		pair<int, string> z;
		z.first = 0;
		z.second = "A";
		for (int i = 0; i < 5; i++)
		{
			a.push_back(z);
			z.second='B'+i;
		}
		bool end = false;
		for (int i = 0; i < 5; i++)
		{
			int x = in() + in();
			if (i == 0 && x == 0)
			{
				end = true;
				break;
			}
			a[i].first += x;
		}
		if (end)break;
		sort(a.begin(), a.end());
		cout << a[4].second << " " << a[4].first << endl;

	}

}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#include<map>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define CC puts("-------ok--------");
#define all(in) in.begin(), in.end()
using namespace std;
typedef pair<int, int> pii;
#define MAX 99999999
int main(){
    pii temp; pii f=pii(0,0);
    pii ans=pii(0,-INF);
    while(cin>>temp.first>>temp.second,temp!=f){
        ans=temp;
        for(int i=1;i<=4;i++){
            cin>>temp.first>>temp.second;
            if(temp.first+temp.second>ans.second){ans.first=i; ans.second=temp.first+temp.second;}
        }
        char u[]={"ABCDE"};
        cout<<u[ans.first]<<" "<<ans.second<<endl;
        }
    
}

C++: #include<stdio.h>
#include<string.h>
int main(void)
{
	int a,b,d,i,j;
	char c[6]="ABCDE";
	scanf("%d %d",&a,&b);
	while(a!=0 && b!=0){
		j=0; d=a+b;
		for(i=1;i<5;i++){
			scanf("%d %d",&a,&b);
			if(a+b>d){
				d=a+b; j=i;
			}
		}
		printf("%c %d\n",c[j],d);
		scanf("% %d",&a,&b);
	}
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
    int a1,a2,a3,a4,a5,b1,b2,b3,b4,b5,i,c,d;
	c=0;
	d=0;
	while(1){
	    scanf("%d %d",&a1,&b1);
		    if(a1==0&&b1==0) break;
			if(c<a1+b1) c=a1+b1;
		scanf("%d %d",&a2,&b2);
		    if(c<a2+b2) c=a2+b2,d=1;
		scanf("%d %d",&a3,&b3);
		    if(c<a3+b3) c=a3+b3,d=2;
		scanf("%d %d",&a4,&b4);
		    if(c<a4+b4) c=a4+b4,d=3;
		scanf("%d %d",&a5,&b5);
		    if(c<a5+b5) c=a5+b5,d=4;
		if(d==0) printf("A %d\n",c);
		else if(d==1) printf("B %d\n",c);
		else if(d==2) printf("C %d\n",c);
		else if(d==3) printf("D %d\n",c);
		else if(d==4) printf("F %d\n",c);
	}
	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;
            }
        }
        for(B=0;B<2;B++){
            cin>>b[B];
            bm+=b[B];
            if(b[B]==0){
                break;
            }
        }
        for(C=0;C<2;C++){
            cin>>c[C];
            cm+=c[C];
            if(c[C]==0){
                break;
            }
        }
        for(D=0;D<2;D++){
            cin>>d[D];
            dm+=d[D];
            if(d[D]==0){
                break;
            }
        }
        for(E=0;E<2;E++){
            cin>>e[E];
            em+=e[E];
            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;
}

C++: #include "bits/stdc++.h"
#define INT long long
using namespace std;

int main()
{
    int a[5],b[5];
    char c[5]={'A','B','C','D','E'};
    for(;;){
        for(int i=0;i<5;i++){
            cin >> a[i] >>b[i];
            if(a[i]==0&&b[i]==0) return 0;
        }
        pair<int,char> p[5];
        for(int i=0;i<5;i++){
            p[i]=make_pair(a[i]+b[i],c[i]);
        }
        sort(p,p+5);
        reverse(p,p+5);
        cout << p[0].second << " " << p[0].first << endl;
    }
    return 0;
}

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

int main() {
	int am,pm;
	int max,max_s;
	
	while(cin>>am>>pm,am||pm){
		max = am + pm;
		max_s = 0;
		for(int i=1;i<5;++i){
			cin>>am>>pm;
			if(max < am + pm){
				max = am + pm;
				max_s = i;
			}
		}
		cout<<(char)('A'+max_s)<<" "<<max<<endl;
	}
	return 0;
}

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

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