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 ()
{
	for (int u = 0; u < 100; u++)
	{
		int a[5],b[5];
		int p = 0;

		for (int i = 0; i < 5; i++)
		{
			cin >> a[i] >> b[i];
			if (a[i] == 0)
			{
				p++;
				break;
			}
		}
		if (p != 0)
		{
			break;
		}

		int gg = 0,ggg = 0;
		for (int i = 0; i < 5; i++)
		{
			if (a[i] + b[i] > gg)
			{
				gg = 0;
				gg = a[i] + b[i];
				ggg = 0;
				ggg = i;
			}
		}


		if (ggg == 0)
		{
			cout << 'A';
		}
		else if (ggg == 1)
		{
			cout << 'B';
		}
		else if (ggg == 2)
		{
			cout << 'C';
		}
		else if (ggg == 3)
		{
			cout << 'D';
		}
		else if (ggg == 4)
		{
			cout << 'E';
		}
		cout << " " << gg << endl;
	}
}

C++: #include<iostream>
using namespace std;
int main() {
	int ms, mn;
	while (true) {
		int a, b;
		cin >> a >> b;
		if (a == 0)break;
		ms = 0;
		mn = a + b;
		for (int i = 1; i <= 4; ++i) {
			cin >> a >> b;
			int num = a + b;
			if (mn < num) {
				ms = i;
				mn = num;
			}
		}
		cout << (char)('A' + ms) << ' ' << mn << endl;
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int a[5],b[5],num;
  while(cin >> a[0] >> b[0],a[0]!=0||b[0]!=0){
    num = 0;
    for(int i=1;i<5;i++){
      cin >> a[i] >> b[i];
      if(a[num]+b[num] < a[i]+b[i]) num = i;
    }
    printf("%c %d\n",'A'+num,a[num]+b[num]);
  }
  return(0);
}

C++: #include<bits/stdc++.h>
using namespace std;

vector<vector<int>> data;

bool input(){
  data.clear();
  data.resize(5);
  for(int i=0;i<5;i++){
    data[i].resize(2);
    cin>>data[i][0]>>data[i][1];
    if(data[i][0]==0&&data[i][1]==0)return false;
  }
  return true;
}

pair<char,int> solve(){
  char max_c;
  int max_n = 0;

  for(int i=0;i<data.size();i++){
    const int n = data[i][0] + data[i][1];
    if(max_n < n){
      max_c = 'A' + i;
      max_n = n;
    }
  }
  return make_pair(max_c,max_n);
}

int main(){
  while(input()){
    auto ans = solve();
    cout<<ans.first<<" "<<ans.second<<endl;
  }
}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <time.h>
#include <math.h>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <sstream>
#include <string>
using namespace std;
#define FOR(I,F,N) for(int I = F; I < (int)(N); I++)
#define rep(i, n) FOR(i, 0, n)
#define FIN(V) cout<<V<<endl
#define pb push_back
#define INF (1 << 30)
typedef pair<int, int> P;
typedef long long ll;
typedef priority_queue<int> pq;
int StrToInt(string);
string IntToStr(int);
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};

int main(void){

	while(1){
		char c = 'A';
		int maxi = 0;
		rep(i, 5){
			int a, b;
			cin >> a >> b;
			if(a == b && a == 0)exit(1);
			if(maxi <= (a+b)){
				maxi = a+b;
				c = 'A'+i;
			}
		}
		cout << c << " " << maxi << endl;
	}

	return 0;
}



int StrToInt(string s){
	stringstream ss;
	ss << s;
	int val;
	ss >> val;
	return val;
}
string IntToStr(int i){
	stringstream ss;
	ss << i;
	return ss.str();
}

C++: #include <iostream>

using namespace std;

int main(int argc, char **argv)
{
	int a, b, tmp = 0, tmp2;
	char w;
	while(1){
		cin >> a >> b;
		
		if(a == 0 && b == 0){
			break;
		} else if(tmp != 0){
			cout << endl;
		}
		
		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;
	}
	
	
	return 0;
}

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

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

int main()
{
  map< int, char, greater<int> > m;
  int s1, s2;
  int i;
  while (cin>>s1>>s2, s1||s2) {
    m.clear();
    m[s1+s2] = 'A';
    for (i = 1; i < 5; i++) {
      cin>>s1>>s2;
      m[s1+s2] = 'A'+i;
    }
    cout<<(*m.begin()).second<<" "<<(*m.begin()).first<<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 <iostream>
#include <string>
using namespace std;

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

C++: #define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, m, n) for(int i=(m); i<(n); ++i)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define Cout(x) cout << (x) << endl
#define Cout2(x, y) cout << (x) << " " << (y) << endl
#define dump(x) cout << #x << " = " << (x) << endl;
#define forauto(i, a) for(auto i : a)cout << i << " "; puts("");
typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
const int inf = 1e9;
const double pi = acos(-1.0);

int main() {
	while (true) {
		int x, y; cin >> x >> y;
		if (x == 0 && y == 0)break;

		VI s(5); s[0] = x + y;
		FOR(i, 1, 5) {
			int a, b; cin >> a >> b;
			s[i] = a + b;
		}

		auto ans = max_element(all(s));
		Cout2((char)('A' + (ans - s.begin())), *ans);
	}
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
typedef std::pair<char,int> info;

bool cmp(const info &p,const info &q){
  return p.second > q.second;
}

int main(){
  int a,s;
  std::vector<info> vec;
  while(true){
    std::cin >> a >> s;
    if(a+s == 0)break;
    vec.clear();
    vec.push_back(info('A',a+s));
    for(int i=1;i<=4;i++){
      std::cin >> a >> s;
      vec.push_back(info((char)('A'+i),a+s));
    }
    sort(vec.begin(),vec.end(),cmp);
    std::cout << vec[0].first << " " << vec[0].second << std::endl;
  }

  return 0;
}

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

int main(){
	int shop[5];
	char ans;int answer;
	
	
	while(true){
		int s1,s2;
		cin>>s1>>s2;
		if(s1==0&&s2==0)break;
		shop[0]=s1+s2;
		
	for(int i=1;i<5;i++){
		cin>>s1>>s2;
		shop[i]=s1+s2;
	}
	for(int i=0;i<5;i++)cout<<shop[i]<<endl;
	answer=0
	for(int i=0;i<5;i++){
	answer=max(shop[i],answer);
	}
	if(answer==shop[0])ans='A';
	if(answer==shop[1])ans='B';
	if(answer==shop[2])ans='C';
	if(answer==shop[3])ans='D';
	if(answer==shop[4])ans='E';
	
	cout<<ans<<" "<<answer<<endl;
}
	return 0;
	
}