#include <iostream>

using namespace std;

int n, m;

int main()
{
	char c1 = 'A', c2 = 'A';
	int ans = 0;
	while (cin >> n >> m && (n || m))
	{
		if(n + m > ans)
		{
			c1++;
			ans = n + m;
		}
		c2++;
		if(c2 > 'E')
		{
			cout << --c1 << " " << ans << endl;
			ans = 0;
			c1 = 'A';
			c2 = 'A';
		}
	}
}