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

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

int main(){
	int a[5],b[5];
	while(cin >> a[0] >> b[0] && (a[0]||b[0])){
		int best = 0;
		for(int i = 1 ; i <= 4 ; i++){
			cin >> a[i] >> b[i];
			if( a[i]+b[i] >= a[best] + b[best] ){
				best = i;
			}
		}
		cout << (char)('A'+best) << " "<< a[best]+b[best] << endl;
		
	}
}

C++: #include<stdio.h>
int main(void)
{
	int n,a,s,i,x[10000],max,flg,c;
	while(1){
		c=0;
			for(i=0;i<5;i++){
				flg=0;
				scanf("%d %d",&a,&s);
					if(a==0&&s==0){
						i=6;
						flg=1;
					}	
					x[i]=a+s;
			}
		if(flg==1) break;
		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<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

int main() {
	while (1) {
		int a[5]{};
		rep(i, 5) {
			int s1, s2; cin >> s1 >> s2;
			if (s1 == 0)return 0;
			a[i] = s1 + s2;
		}
		int*ans = max_element(a, a + 5);
		cout << (char)(ans - a + 'A') << ' ' << *ans << endl;
	}
}

C++: #include<iostream>
#include<string>
#include<algorithm>	
#include<cmath>
using namespace std;
int main() {
	long long n, a; char b;
	for (int h = 0; h < 100; h++) {
		int sum = 0;
		for (int i = 0; i < 5; i++) {
			cin >> n >> a;
			if (n == 0 && a == 0) {
				cin >> n; return 0;
			}
			if (n + a > sum) {
				sum = n + a;
				if (i == 0) { b = 'A'; }
				if (i == 1) { b = 'B'; }
				if (i == 2) { b = 'C'; }
				if (i == 3) { b = 'D'; }
				if (i == 4) { b = 'E'; }
			}
		}
		cout << b << ' ' << sum << endl;
	}
	cin >> n;
}

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

typedef std::pair<int, int> P;

int main()
{
	int s1, s2;
	while( std::cin >> s1 >> s2, s1 | s2 )
	{
		P ans( s1 + s2, 0 );
		for( int i = 0; i != 4; ++i )
		{
			std::cin >> s1 >> s2;
			ans = std::max( ans, P( s1 + s2, i + 1 ) );
		}
		std::cout << char( 'A' + ans.second ) << ' ' << ans.first << std::endl;
	}

	return 0;
}

C++: #include <cstdio>
#include <algorithm>
using namespace std;
struct map {int n, s; };
bool comp(const map& a, const map& b) {
    return a.s>b.s;
}
map x[5];
int main() {
    int s1, s2;
    while (scanf("%d%d",&s1,&s2)) {
        if (!s1&&!s2) break;
        x[0]=(map){0,s1+s2};
        for (int i=1; i<5; i++) {
            scanf("%d%d",&s1,&s2);
            x[i]=(map){i,s1+s2};
        }
        sort(x,x+5,comp);
        printf("%c %d\n",x[0].n+'A',x[0].s);
    }
}

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;
            }
        }
        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 <iostream>
#include <map>
#include <algorithm>
using namespace std;
int main(void){
	pair<int,char> A[5];
	for(int f=0;f!=1;){
		for(int i=0,a,b;i<5;++i){
			cin>>a>>b;
			if(a==0&&b==0){f=1;break;}
			A[i].first=a+b;
			A[i].second=(char)(i+'A');
			if(i==4){
				sort(&A[0],&A[5],greater<pair<int,char> >());
				cout<<A[0].second<<" "<<A[0].first<<endl;
			}
		}
	}
	return 0;
}

C++: #include <iostream>

int main(){
	int n, m, max;
	char s;

	while(std::cin >> n >> m, n&&m){
		max = n + m, s = 'A';
		for(int i=0;i<4;i++){
			std::cin >> n >> m;
			if(n + m > max)max = n + m, s = 'B' + i;
		}

		std::cout << s << " " << max << '\n';
	}
}

C++: #include<iostream>

using namespace std;

typedef struct{
  char name;
  int sum;
}Store;

int main(){
  Store data[5];
  int am,pm;
  while(cin >> am >> pm && am + pm){
    char now = 'A';
    data[0].name = now;
    data[0].sum = am+pm;
    for(int i = 1; i < 5; i++){
      now++;
      cin >> am >> pm;
      data[i].name = now;
      data[i].sum = am+pm;
    }
    Store max = data[0];
    
    for(int i = 1; i < 5; i++){
      if(data[i].sum > max.sum) max = data[i];
    }

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

  return 0;
}

C++: #include<cstdio>
#include<cstring>
#include<algorithm>
#include<functional>
#include<vector>
#include<stack>
#include<queue>
#include<iostream>
using namespace std;
int main(void)
{
	int sum=0,mx=-1,ss,s,pl,flg=0;
	char pp[5]={'A','B','C','D','E'};
	while(1) {
		for(int i=0;i<5;i++) {
			sum=0;
			cin>>s>>ss;
			if(s==0 && ss==0) {flg=1;break;}
			sum=s+ss;
			if(mx<sum) {mx=sum;pl=i;}
		}
		if(flg==1)break;
		cout<<pp[pl]<<" "<<mx<<endl;
	}
}

C++: #include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
    int n,m;
    while(scanf("%d%d",&n,&m),n||m){
        int mav=0,mac=n+m;
        for(int i=1;i<5;i++){
            scanf("%d%d",&n,&m);
            if(n+m>mac){
                mac=n+m;
                mav=i;
            }
        }
        printf("%c %d\n",'A'+mav,mac);
    }

    return 0;
}

C++: #include<stdio.h>
#include<string.h>
int main(void)
{
	int a[5],b[5],d,i,j;
	char c[5]="ABCDE";
	scanf("%d %d",&a[0],&b[0]);
	while(a[i]!=0 || b[i]!=0){
		j=0; d=0;
		if(a[i]+b[i]>d){
			d=a[i]+b[i]; j=i;
		}
		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);
		i=0;
		scanf("% %d",&a[i],&b[i]);
	}
	return 0;
}

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

int main(){

	int s1, s2;

	while (cin >> s1 >> s2 && s1 != 0 && s2 != 0){

		int sum[5];
		int max;
		int num;
		sum[0] = s1 + s2;
		max = sum[0];
		num = 0;
		for (int i = 1; i < 5; i++){
			cin >> s1 >> s2;
			sum[i] = s1 + s2;
			if (max < sum[i]){
				max = sum[i];
				num = i;
			}
		}

		cout << (char)('A' + num) << ' ' << max << endl;
	}
}