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 <bits/stdc++.h>
using namespace std;
int main(void){
    int a,b,max,tmp;
    tmp=-1;
    while (cin>>a>>b) {
        if (a==0&&b==0) {
            break;
        } else {
            max=a+b;
            for (int i=0;i<4;i++) {
                cin>>a>>b;
                if (max<a+b) {
                    max=a+b;
                    tmp=i;
                }
            }
            if (tmp==-1) {
                cout<<"A"<<" "<<max<<endl;
            } else if (tmp==0) {
                cout<<"B"<<" "<<max<<endl;
            } else if (tmp==1) {
                cout<<"C"<<" "<<max<<endl;
            } else if (tmp==2) {
                cout<<"D"<<" "<<max<<endl;
            } else if (tmp==3) {
                cout<<"E"<<" "<<max<<endl;
            }
            tmp=-1;
        }
    }
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <limits>
#include <cmath>
#include <cassert>

using namespace std;
using ll = long long;

const int INF = 1<<30;
const int MOD = (int)1e9 + 7;
const int MAX_N = (int)1e5 + 5;
#define debug(x) cout << #x << ": " << x << endl

signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int s, t;
    while(cin >> s >> t, s or t)
    {
        vector<int> shop(5, 0);
        shop[0] = s + t;
        for(int i = 1; i <= 4; i++)
        {
            cin >> s >> t;
            shop[i] = s + t;
        }
        int maxv = 0;
        char ans;
        for(int i = 0; i < 5; i++)
        {
            if(maxv < shop[i])
            {
                maxv = shop[i];
                ans = 'A' + i;
            }
        }
        cout << ans << " " << maxv << endl;
    }
    return 0;
}

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

int main()
{
    int s1;
    int s2;

    while (cin >> s1 >> s2 && s1 && s2){
        int sum = s1 + s2;
        char name = 'A';
        for (int i = 0; i < 5; i++){
            cin >> s1 >> s2;
            if (s1 + s2 > sum){
                sum = s1 + s2;
                name = (char)('A' + i);
            }
        }
        cout << name << " " << sum << 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 <algorithm>
#include <cassert>
#include <cctype>
#include <complex>
#include <cstdio>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;

typedef pair<int,int> P;
int a,b;
P p[5];

int main(){
	while(cin>>a>>b){
		if(!a)return 0;
		p[0]=make_pair(a+b,0);
		for(int i=1;i<5;i++){
			cin>>a>>b;
			p[i]=make_pair(a+b,i);
		}
		sort(p,p+5);
		cout<<(char)('A'+p[4].second)<<" "<<p[4].first<<endl;
	}
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define F first
#define S second
typedef pair<int,int> pii;
main(){
	vector<pii> v(5);
	while(cin>>v[0].F,v[0].F){
		int t;
		cin>>t;
		t+=v[0].F;
		v[0].S=0;
		for(int i=1;i<5;i++){
			cin>>t;v[i].F=t;
			cin>>t;v[i].F+=t;
			v[i].S=i;
		}
		sort(v.begin(),v.end());
		char r='A'+v[4].S;
		cout<<r<<" "<<v[4].F<<endl;
	}
}

C++: #include <iostream>

using namespace std;

int main(int argc, char **argv)
{
	int a, b, tmp, tmp2;
	char w;
	while(1){
		cin >> a >> b;
		if(a == 0 && b == 0){
			break;
		}
		
		w = 'A';
		tmp = a + b;
		tmp = 0;
		for(int i = 1; i <= 4; i++){
			cin >> a >> b;
			if(tmp < (a+b)){
				tmp = a + b;
				tmp2 = i;
			}
		}
		
		cout << (char)(w+tmp2) << " " << tmp << endl;
	}
	
	
	return 0;
}

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

int main(void){
  int a, b;
  
  while (cin >> a >> b){
    vector<pair<int, int> > v;
    if (a==0 && b==0) break;
    v.push_back(make_pair(a+b, 0));
    for (int i=1; i<5; i++){
      cin >> a >> b;
      v.push_back(make_pair(a+b, i));
    }
    sort(v.begin(), v.end());
    cout << (char)('A'+v[4].second) << " " << v[4].first << endl;
  }
  return 0;
}

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

int main() {
  int a,b;
  while(cin >> a >> b && (a!=0 || b!=0)) {
    int sum,max,ans=0;
    sum=max=a+b;
    for(int i=1; i<5; i++) {
      cin >> a >> b;
      sum=a+b;
      if(sum>max) {
	max=sum;
	ans=i;
      }
    }
    cout << (char)('A'+ans) << " " << max << endl;
  }
  return 0;
}

C++: #include <iostream>

using namespace std;

void solve()
{
	int am, pm;
	while(cin >> am >> pm)
	{
		if(!am && !pm)
		{
			break;
		}
		int sum[5] = {0};
		sum[0] = am + pm;
		int index = 0;
		int max = sum[0];
		for(int i = 1; i < 5; ++i)
		{
			cin >> am >> pm;
			sum[i] = am + pm;
			if(sum[i] > max)
			{
				max = sum[i];
				index = i;
			}
		}
		printf("%c %d\n", 'A' + index, max);
	}
}

int main()
{
	solve();
	return(0);
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define F first
#define S second
typedef pair<int,int> pii;
int main(){
	vector<pii> v(5);
	while(cin>>v[0].F,v[0].F){
		int t;
		cin>>t;
		t+=v[0].F;
		v[0].S=0;
		for(int i=1;i<5;i++){
			cin>>t;v[i].F=t;
			cin>>t;v[i].F+=t;
			v[i].S=i;
		}
		sort(v.begin(),v.end());
		char r='A'+v[4].S;
		cout<<r<<" "<<v[4].F<<endl;
	}
}

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

C++: #include<stdio.h>
int main(void)
{
    char str[7] = { "\nABCDE" };
    int i, s1[6], s2[6], temp[6], max[6];
        for (i = 1; i <= 5; i++) {
            scanf("%d %d", &s1[i], &s2[i]);
            temp[i] = s1[i] + s2[i];
            if (s1[1] <= 0 && s2[1] <= 0) {
                break;
                
            }

        }
        while (s1[1] > 0 && s2[1] > 0) {

            for (i = 1; i <= 5; i++) {
                if (temp[i] > max[1]) {
                    max[2] = max[1];
                    max[1] = temp[i];
                }
                else if (temp[i] > max[2]) {
                    max[3] = max[2];
                    max[2] = temp[i];
                }
                else if (temp[i] > max[3]) {
                    max[4] = max[3];
                    max[3] = temp[i];
                }
                else if (temp[i] > max[4]) {
                    max[5] = max[4];
                    max[4] = temp[i];
                }
                else {
                    max[5] = temp[i];
                }
            }

            for (i = 1; i <= 5; i++) {
                if (max[1] == temp[i]) {
                    printf("%c %d\n", str[i], temp[i]);
                }

            }
            for (i = 1; i <= 5; i++) {
                scanf("%d %d", &s1[i], &s2[i]);
                temp[i] = s1[i] + s2[i];
                if (s1[1] <= 0 && s2[1] <= 0) {
                    break;
                }
            }
        }
    
    return 0;
}