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 <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define SORT(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define EQ(a,b) (abs((a)-(b))<eps)
int main()
{
	string str = "ABCDE";
	while(1)
	{
		int v=-1,n;
		for(int i=0;i<5;i++)
		{
			int a,b;
			cin >> a >> b;
			if(a==0&&b==0)goto end;
			if(v<a+b)
			{
				v = a+b;
				n = i;
			}
		}
		cout << str[n] << ' ' << v << endl;
	}
	end:;
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int s1,s2,x,x1,i;
	char w[]={"ABCDE"};
	while(1){
		scanf("%d%d",&s1,&s2);
		if(s1==0&&s2==0) break;
		x=s1+s2; x1=0;
		for(i=1;i<5;i++){
			scanf("%d%d",&s1,&s2);
			if(x<s1+s2){
				x=s1+s2; x1=i;
			}
		}
		printf("%c %d\n",w[x1],x);
	}
	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;
		if(a == 0  && b == 0) break;
		for(int i=0;i<5;i++){
					cin >> a >> b;
			if(max < a+b) {
				max =a+b;
				maxchar=i;
			}
		}
		cout << c[maxchar] << " " << max << endl;
	}
}

C++: #include <stdio.h>
#include <stack>
#include <math.h>

using namespace std;



int main(){

	int gozen,gogo,most_value,most_index;

	while(true){
		scanf("%d %d",&gozen,&gogo);
		if(gozen == 0 && gogo == 0)break;

		most_value = gozen+gogo;
		most_index = 0;

		for(int i=1; i <= 4; i++){
			scanf("%d %d",&gozen,&gogo);

			if(most_value < gozen + gogo){
				most_value = gozen + gogo;
				most_index = i;
			}
		}

		switch(most_index){
		case 0:printf("A ");break;
		case 1:printf("B ");break;
		case 2:printf("C ");break;
		case 3:printf("D ");break;
		case 4:printf("E ");break;
		}

		printf("%d\n",most_value);
	}



    return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int s[5],s1,s2,i,temp,j,x;
	while(1){
		scanf("%d %d",&s1,&s2);
		if(s1==0&&s2==0)break;
		s[0]=s1+s2;
		for(i=0;i<4;i++){
			scanf("%d %d",&s1,&s2);
			s[i]=s1+s2;
		}
		for(i=0;i<5;i++){
			for(j=i+1;j<5;j++){
				if(s[i]<s[j]){
					temp=s[i];
					s[i]=s[j];
					s[j]=s[i];
					x=i;
				}
			}
		}
		if(x==0){
			printf("A %d\n",s[0]);
		}
		if(x==1){
			printf("B %d\n",s[0]);
		}
		if(x==2){
			printf("C %d\n",s[0]);
		}
		if(x==3){
			printf("D %d\n",s[0]);
		}
		if(x==4){
			printf("E %d\n",s[0]);
		}
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
constexpr char name[5]{'A', 'B', 'C', 'D', 'E'};

int main() {
    while (true) {
        int n_max = 0, name_idx;
        for (int i = 0; i < 5; ++i) {
            int a, p;
            cin >> a >> p;
            const int sum = a + p;
            if (sum == 0)
                exit(0);
            else if (sum > n_max) {
                n_max = sum;
                name_idx = i;
            }
        }
        cout << name[name_idx] << ' ' << n_max << endl;
    }
}

C++: #include<stdio.h>
int main(void)
{
	int a,s,d,f=-1,g,h,j,i;
	scanf("%d %d",&a,&s);
	while(1){
		if(a==0&&s==0){
			break;
		}
		d=a+s;
		//printf("%d\n",d);
		g=1;
		for(i=2;i<=5;i++){
			scanf("%d %d",&a,&s);
			if(d<a+s){
				d=a+s;
				g=i;
			}
		}
		if(g==1)
			printf("A ");
		if(g==2)
			printf("B ");
		if(g==3)
			printf("C ");
		if(g==4)
			printf("D ");
		if(g==5)
			printf("E ");
		printf("%d\n",d);
		scanf("%d %d",&a,&s);
	}

	return 0;
}

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

C++: #include<iostream>
#include<cstdio>
#include<string>
#include<map>
#include<algorithm>
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>

using namespace std;

int n, m;

int main()
{
	char c1 = 'A', c2 = 'A';
	int ans = 0;
	while (cin >> n >> m && (n || m))
	{
		if(n + m > ans)
		{
			c1++;
			ans = n + m;
		}
		c2++;
		if(c2 > 'E')
		{
			cout << --c1 << " " << ans << endl;
			ans = 0;
			c1 = 'A';
			c2 = 'A';
		}
	}
}

C++: #include<stdio.h>
int main(void)
{
    int a[5],b[5],i,c,d;
	c=0;
	d=0;
	for(i=0;i<5;i++){
		scanf("%d %d",&a[i],&b[i]);
	}
	while(1){
	    if(a[0]==0&&b[0]==0) break;
		for(i=0;i<5;i++){
		    if(c<a[i]+b[i]){
			    c=a[i]+b[i];
				d=i;
			}
		}
		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);
		for(i=0;i<5;i++){
		    scanf("%d %d",&a[i],&b[i]);
			if(a[0]==0&&b[0]==0) break;
		}
	}
	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 << " " << date[Getmax(m,5)] <<endl;
	}
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
    int a1,a2,a3,a4,a5,b1,b2,b3,b4,b5,i,c,d;
	scanf("%d %d",&a1,&b1);
	while(1){
	    c=0;
		d=0;
		    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);
		scanf("%d %d",&a1,&b1);
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
	vector<int>in(5);
	int a,b;
	while(cin>>a>>b,a||b){
		in[0]=a+b;
		loop(i,1,5){
			cin>>a>>b;
			in[i]=a+b;
		}
		int maxi=0;
		rep(i,5)maxi=max(maxi,in[i]);
		rep(i,5)if(maxi==in[i])cout<<(char)('A'+i)<<" "<<in[i]<<endl;
	}
}