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 <stdio.h>

int main(void) {
	int a[100], b[100];
	int i = 0;
	int max = 0;
	int maxbox = 0;
	char shop[] = { 'A','B','C','D','E' };

	while (1) {

		for (i = 0; i < 5; i++) {
			scanf("%d %d", &a[i], &b[i]);

			if (a[i] == 0 && b[i] == 0) {
				break;
			}
			if (i >= 1) {
				if (a[i] + b[i] > max) {
					max = a[i] + b[i];
					maxbox = i;
				}
			}
			else {
				max = a[i] + b[i];
				maxbox = i;
			}
		}
		if (a[i] == 0 && b[i] == 0) {
			break;
		}
		switch (maxbox) {
		case 0:
			printf("%c %d\n", shop[maxbox], max);
			break;
		case 1:
			printf("%c %d\n", shop[maxbox], max);
			break;
		case 2:
			printf("%c %d\n", shop[maxbox], max);
			break;
		case 3:
			printf("%c %d\n", shop[maxbox], max);
			break;
		case 4:
			printf("%c %d\n", shop[maxbox], max);
			break;
		default:
			break;
		}
	}

	return 0;
}

C++: #define _USE_MATH_DEFINES
#define INF 10000000
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>

using namespace std;

typedef long long ll;
typedef pair<int,int> P;

static const double eps = 1e-8;

int main(){
	int am,pm;
	while(~scanf("%d %d",&am,&pm)){
		if(am == pm && pm == 0) break;
		int maxV = -1;
		char alph;
		if(maxV < am+pm){
			alph = 'A';
			maxV = am+pm;
		}
		for(int i=0;i<4;i++){
			scanf("%d %d",&am,&pm);
			if(maxV < am+pm){
				alph = 'A'+i+1;
				maxV = am+pm;
			}
		}
		printf("%c %d\n",alph,maxV);
	}
}

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>
using namespace std;

int main(){
	while(1){
		int s1,s2;
		int maxc=0;
		int max=0;
		for(int i=0;i<5;i++){
			cin >> s1 >> s2;
			if(!s1&&!s2)return 0;
			if(s1+s2>max){
				max = s1 + s2;
				maxc = 'A'+i;
			}
		}
		cout << maxc << " " << max << endl;
	}
}

C++: /* 
 * File:   main.cpp
 * Author: freebsd
 *
 * Created on 2014/08/28, 10:07
 */

#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) return 0;
        }
        
        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 <iostream>
#include <vector>
using namespace std;
int main( void )
{
	while ( 1 )
	{
		int max_no = -1;
		int max_value = 0;
		for ( int i = 0; i < 5; i++ )
		{
			int a, b;
			cin >> a >> b;
			if ( a == 0 && b == 0 )
				break;
			if ( a+b > max_value )
			{
				max_no = i;
				max_value = a+b;
			}
		}
		if ( max_no == -1 )
			break;
		cout << (char)('A'+max_no) << " " << max_value << endl;
	}
}

C++: #include <stdio.h>

int main()
{
        int shop[5];
        int m,e;
        int i=0,top_s,max=0;

        while (scanf("%d %d", &m, &e) && (m != 0 || e != 0)) {
                shop[i] = m+e;
                if (shop[i] > max) {
                        max = shop[i];
                        top_s = i;

                }

                i++;

                if (i > 4) {
                        printf("%c %d", top_s+'A', max);
                        i = max = 0;
                }


        }
        return 0;
}

C++: #include "bits/stdc++.h"

using namespace std;
		int store = 0;
		int s[10];
		int a[5];
		int ma = 0;
		bool unko = 0;

int main (){
	
	while(1){
		ma = 0;
		unko = 0;
		store = 0;
		int i;
	for(int k = 0;k <= 4;k++){
		i = 2 * k;
	cin >> s[i] >>s[i + 1];
	if(s[i] == 0 && s[i + 1] == 0) 
		{unko = 1; 
	break;
	}
	a[k] = (s[i] + s[i + 1]);
	if(ma < a[k]) {
		store = k;
		ma = a[k];
	}
	}
	if(unko == 1)break;
	switch(store){
	case 0:
		cout << "A " << ma <<endl;
		break;

	case 1:
		cout << "B " << ma <<endl;
		break;

	case 2:
		cout << "C " << ma <<endl;
		break;

	case 3:
		cout << "D " << ma <<endl;
		break;

	case 4:
		cout << "E " << ma <<endl;
		break;
	}



	}

	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int A[5],B[5];
string S;
int main()
{
	S="ABCDE";
	while(true){
		scanf("%d%d",&A[0],&B[0]);
		if(A[0]==0&&B[0]==0)return 0;
		for(int i=1;i<5;i++){
			scanf("%d%d",&A[i],&B[i]);
		}
		int ma=-1;int maxi=-1;
		for(int i=0;i<5;i++){
			if(ma<A[i]+B[i]){
				ma=A[i]+B[i];
				maxi=i;
			}
		}
		cout << S[maxi] << " " << ma << "\n";
	}
}

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

C++: #include<iostream>
using namespace std;
int main(){
  int z,g,max,maxd;
  char a[5]={'A','B','C','D','E'};
  while(cin>>z>>g){
    if(z==0&&g==0) break;
    max = z + g;
    maxd = 0;
    for(int i=1;i<=4;i++){
      cin >> z >> g;
      if(z+g>max){
	max = z+g;
	maxd = i;
      }
    }
    cout << a[maxd] << ' ' << max << endl;
  }
  return 0;
}

C++: #include<stdio.h>
#include<algorithm>

using namespace std;

int main(){
	
	while(1){
		int max;
		int maxnum;
		max=0;
		for(int i=0;i<5;i++){
			int a,b;
			scanf("%d%d",&a,&b);
			if(a==0 && b==0){
				goto A;
			}
			if(a+b>max){
				max=a+b;
				maxnum=i;
			}
		}
		printf("%c %d\n",'A'+maxnum,max);
	}
	A:
	return 0;
}

C++: #include <iostream>
using namespace std;
int main() {
	while (1) {
		int n[5], ans = 0, m = 0;
		for (int i = 0; i < 5; i++) {
			int a, b;
			cin >> a >> b;
			if (a == 0 && b == 0) return 0;
			n[i] = a + b;
		}
		for (int i = 0; i < 5; i++) {
			if (m < n[i]) {
				m = n[i];
				ans = i;
			}
		}
		if (ans == 0) cout << "A " << m << endl;
		if (ans == 1) cout << "B " << m << endl;
		if (ans == 2) cout << "C " << m << endl;
		if (ans == 3) cout << "D " << m << endl;
		if (ans == 4) cout << "E " << m << endl;
	}
	return 0;
}