import std.stdio, std.conv;

void main() {
  while(true) {
    int ans = 0, index = -1;
    for(int i = 0; i < 5; i++) {
      int a, b; readf("%d %d\n", &a, &b);
      if (a + b == 0) goto end;
      if (a + b > ans) {
        ans = a + b;
        index = i;
      }
    }
    writeln((index + 'A').to!char, " ", ans);
  }
end:;
}