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++: #include<iostream>
#include<algorithm>
#include<string>
using namespace std;

int main() {
	int a[5] = {};
	int aa[5] = {};
	string s[5] = { "A","B","C","D","E" };
	int b, c;
	while (cin >> b >> c, b, c) {
		int d, e;
		a[0] = b + c;
		aa[0] = a[0];
		for (int i = 0; i < 4; i++) {
			cin >> d >> e;
			a[i + 1] = d + e;
			aa[i + 1] = a[i + 1];
		}
		sort(aa, aa + 5);

		for (int i = 0; i < 5; i++) {
			if (a[i] == aa[4]) {
				cout << s[i] << ' '<<a[i]<<endl;
				break;
			}
		}

	}
	return 0;
}

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 %d",&a,&b);
	}
	return 0;
}

C++: #include <cstdio>

using namespace std;

int main() {
    while (true) {
        int s1[5] = {0}, s2[5] = {0};
        
        char store[5] = {'A', 'B', 'C', 'D', 'E'};
        
        char result = 0;
        
        for(int i = 0; i < 5; i++) {
            scanf("%d %d", &s1[i], &s2[i]);
        }
        
        if(s1[0] == 0 && s2[0] == 0) break;
        
        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 != 3) {
            
            if(max < s1[i + 1]) {
                max = s1[i + 1];
                tempc = store[i + 1];
            }
            i++;
        }
        
        result = store[i];
        
        printf("%c %d", tempc, max);
    }
}

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

C++: #include<stdio.h>



int main()
{
	int a ,b ;


	while( 1 )
	{
		scanf( "%d %d" ,&a ,&b ) ;


		if( ( a | b ) == 0 )
		{
			return 0 ;
		}


		char c = 'A' ;

		int ans = a + b ;


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



			if( ans < a + b )
			{
				ans = a + b ;

				c = i + 'A' ;
			}
		}



		printf( "%c %d\n" ,c ,ans ) ;
	}
}

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

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

C++: #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
	enum tol { a, b, c, d, e };
	vector<tol>l;
	int a1, a2;
	while (cin >> a1 >> a2){
		if (a1 == 0 && a2 == 0)break;
		int o[5];
		int oo[5];
		a1 += a2;
		o[0] = a1;
		for (int i = 1; i < 5; i++) {
			cin >> a1 >> a2;
			a1 += a2;
			o[i] = a1;
		}
		for (int i = 0; i < 5; i++)oo[i] = o[i];
		sort(oo, oo + 5);
		if		(oo[4] == o[0])l.push_back(a);
		else if (oo[4] == o[1])l.push_back(b);
		else if (oo[4] == o[2])l.push_back(c);
		else if (oo[4] == o[3])l.push_back(d);
		else if (oo[4] == o[4])l.push_back(e);
	}
	for (tol p : l) {
		if (p == a)cout << "A";
		else if (p == b)cout << "B";
		else if (p == c)cout << "C";
		else if (p == d)cout << "D";
		else if (p == e)cout << "E";
		cout << endl;
	}
	char ch;
	cin >> ch;
}

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

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);

signed main() {
	int a, b; vector<int>v(5);
	while (cin >> a >> b, a || b) {
		v[0] = a + b;
		rep(i, 1, 5) {
			cin >> a >> b;
			v[i] = a + b;
		}
		cout << char('A' + distance(v.begin(), max_element(all(v))))<<" "<<*max_element(all(v)) << endl;
	}
	return 0;
}

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


int main(){
	int a[5];
	int x,y;
	while(cin>>x>>y,x|y){
		a[0]=x+y;
		for(int i=1;i<5;i++)cin>>x>>y,a[i]=x+y;
		int *p=max_element(a,a+5);
		cout<<(char)(p-a+'A')<<' '<<*p<<endl;
	}
	return 0;
}

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

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

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

int main() {
    int s, t;
    vector<int> v(5);
    while (cin >> s >> t, v[0] = s + t) {
        for (int i = 1; i < 5; i++) cin >> s >> t, v[i] = s + t;
        auto it = max_element(v.begin(), v.end());
        cout << (char)('A' + (it - v.begin())) << " " << *it << endl;
    }
    return 0;
}

C++: #include <iostream>

using namespace std;

int main(void)
{
	int a,b,max;
	char name;

	while( cin >> a >> b && a != 0 && b != 0 ){
		max = a + b;
		name = 'A';

		for( int i = 0;i < 4;i++ ){
			cin >> a >> b;
			if( max < a + b ){
				max = a + b;
				name = 'B' + i;
			}
		}

		cout << name << " " << max << endl;
	}

	return 0;
}

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

using namespace std;

int main(void){
	while(1){
		int a,b,c;
		int max,name=0;
		char na[6]="ABCDE";
		cin >> b >> c;
		if(b==0 && c==0)break;
		max=b+c;
		for(a=1;a<=4;a++){
			cin >> b >> c;
			if(b+c>max)name=a,max=b+c;
		}
		cout << na[name] << " " << max << endl;
	}
	return 0;
}