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>
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;
		
		for(int i=0;i<5;i++){
					cin >> a >> b;
			if(a == 0  && b == 0) break;
			if(max < a+b) {
				max =a+b;
				maxchar=i;
			}
		}
		cout << c[maxchar] << " " << max << endl;
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
    int a1, a2, b1, b2, c1, c2, d1, d2, e1, e2;
    while (cin >> a1 >> a2 && a1 && a2 && cin >> b1 >> b2 >> c1 >> c2 >> d1 >> d2 >> e1 >> e2) {
        int a = a1 + a2;
        int b = b1 + b2;
        int c = c1 + c2;
        int d = d1 + d2;
        int e = e1 + e2;
        int maxv = max({ a, b, c, d, e });
        if (maxv == a) cout << "A ";
        if (maxv == b) cout << "B ";
        if (maxv == c) cout << "C ";
        if (maxv == d) cout << "D ";
        if (maxv == e) cout << "E ";
        cout << maxv << endl;
    }
}

C++: #include <iostream>
using namespace std;
int main(void){
    while(true){
        int max=0;
        char num;
        for(int i=0;i<5;i++){
            int a,b;
            cin >> a >> b;
            if(i==0 && (a|b)==0)return 0;
            if(max<(a+b)){
                max=a+b;
                num ='A'+i;
            }
        }
        cout << num << " " << max << endl;
    }
    return 0;
}

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

C++: #include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
using namespace std;

int main(){
	while(1){
		int m[5],a[5];
		cin>>m[0]>>a[0];
		if(m[0]==0&&a[0]==0) break;
		rep(i,1,5) cin>>m[i]>>a[i];
		pair<int,int> data[5];
		rep(i,0,5){
			data[i].first=m[i]+a[i];
			data[i].second=i;
		}
		sort(data,data+5);
		char c='A'+data[4].second;
		cout<<c<<" "<<data[4].first<<endl;
	}
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<map>
using namespace std;
#define P pair<int, char>

int main(){
    int tmp1, tmp2;
    while(cin >>tmp1 >>tmp2){
        if(tmp1 == 0 && tmp2 == 0) break;
        vector<P> vec;
        char shop[5] = {'A', 'B', 'C', 'D', 'E'};
        vec.push_back( make_pair(tmp1 + tmp2, shop[0]) );
        for(int i = 1; i < 5; i++){
            cin >>tmp1 >>tmp2;
            vec.push_back( make_pair(tmp1 + tmp2, shop[i]) );
        }
        sort(vec.begin(), vec.end());
        cout <<vec[vec.size() - 1].second <<" " <<vec[vec.size() - 1].first <<endl;
    }
    return 0;
}

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

using namespace std;

int main()
{
	while(1){
		pair<int,int> n[5];
		int am,pm;
		for(int i=0;i<5;i++)	cin>>am>>pm,n[i]=make_pair(am+pm,i);
		if(cin.eof())	break;
		sort(n,n+5);
		cout<<(char)('A'+n[4].second)<<' '<<n[4].first<<endl;
	}
	return 0;
}

C++: #include<stdio.h>
#include<iostream>
#include<string>
#include<algorithm>
#include <vector>
#include<math.h>

using namespace std;
int main(){
	int max=0,a,b;
	char ch='A';
	while(1){
		cin>>a>>b;
		max=a+b;ch='A';
		if(a==0&&b==0)break;
		for(int i=0;i<4;i++)
		{
			cin>>a>>b;
			if(max<a+b){
				max=a+b;
				if(i==0)ch='B';
				if(i==1)ch='C';
				if(i==2)ch='D';
				if(i==3)ch='E';
			}
			
		}cout<<ch<<" "<<max<<endl;
	}
		return 0;
	}

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

int main(){
	int sum[5], n, m, ans;
	bool flag = false;

	while(1){
		for(int i=0 ; i<5 ; i++){
			sum[i] = 0;

			cin >> n >> m;
			if( n==0 && m==0 ){
				flag = true;
				break;
			}
			sum[i] += n+m;
		}
		if( flag ) break;
		ans = 0;
		for(int i=1 ; i<5 ; i++){
			if( sum[ans] < sum[i]) ans = i;
		}
		char s = ans + 'A';
		cout << s << " " << sum[ans] << endl;
	}

	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;
		
		for(int i=0;i<5;i++){
					cin >> a >> b;
			if(a == 0  && b == 0) break;
			else if(max < a+b){
				max =a+b;
				maxchar=i;
			}
		}
			if(a == 0 && b ==0) break;
		cout << c[maxchar] << " " << max <<endl;
				
	}
		
		}

C++: #include<stdio.h>
int main()
{
	char r[5]={'A','B','C','D','E'};
	int s1[5],i,s2[5],m=0,l;
	while(1){
		for(i=0;i<5;i++){
			scanf("%d%d",&s1[i],&s2[i]);
			if(s1[i]==0&&s2[i]==0){
				return 0;
			}
		}
		for(i=0;i<5;i++){
			if(m<s1[i]+s2[i]){
				m=s1[i]+s2[i];
				l=i;
			}
		}
		printf("%c %d\n",r[l],m);
		m=0;
	}
	return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
	enum tol { a, b, c, d, e };
	vector<tol>l;
	vector<int>ll;
	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);
			ll.push_back(o[0];)
		}
		else if (oo[4] == o[1]) {
			l.push_back(b); 
			ll.push_back(o[1]);
		}
		else if (oo[4] == o[2]) { 
			l.push_back(c); 
			ll.push_back(o[2]);
		}
		else if (oo[4] == o[3]) { 
			l.push_back(d);
			ll.push_back(o[3]);
		}
		else if (oo[4] == o[4]) {
			l.push_back(e);
			ll.push_back(o[4]);
		}
	}
	for (int p = 0; p < l.size();p++){
		if (l[p] == a)cout << "A";
		else if (l[p] == b)cout << "B";
		else if (l[p] == c)cout << "C";
		else if (l[p] == d)cout << "D";
		else if (l[p] == e)cout << "E";
		cout << ' ' << ll[p] << endl;
		cout << endl;
	}
	char ch;
	cin >> ch;
}

C++: #include<cstdio>
#include<iostream>
using namespace std;
int main(void){
	int flg=1,i,max,a,b,mise;
	char s[]="ABCDE";
	while(1){
		max=-1;
		for(i=0;i<5;i++){
			cin>>a;
			cin>>b;
			if(max<a+b){
				mise=i;
				max=a+b;
			}
			if(max==0){
				flg=0;
				break;
			}
		}
		if(flg==0) break;
		cout<<s[mise]<<' '<<max<<endl;
	}
	return 0;
}

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

int main()
{
	int s1, s2;
	
	while (cin >> s1 >> s2, s1 || s2){
		
		int max = s1 + s2, max_n = 0 + 'A';
		
		for (int i = 1; i < 5; i++){
			cin >> s1 >> s2;
			if (max < s1 + s2){
				max = s1 + s2;
				max_n = i + 'A';
			}
		}
		
		printf("%c %d\n", max_n, max);
	}
	return (0);
}