#include <bits/stdc++.h>
using namespace std;
char a[9][9];
int main() {
  for (int i = 0; i < 8; ++i) {
    scanf("%s", &a[i]);
  }
  int mn = 10;
  char ans = 'W';
  for (int i = 0; i < 8; ++i)
    for (int j = 0; j < 8; ++j) {
      if (a[i][j] == 'W') {
        int vv = 0;
        for (int k = i - 1; k > -1; --k) {
          if (a[k][j] != '.') {
            vv = 0;
            break;
          }
          ++vv;
        }
        if (vv == 0) continue;
        if (vv <= mn) {
          mn = vv;
          ans = 'A';
        }
      } else if (a[i][j] == 'B') {
        int vv = 0;
        for (int k = i + 1; k < 8; ++k) {
          if (a[k][j] != '.') {
            vv = 0;
            break;
          }
          ++vv;
        }
        if (vv == 0) continue;
        if (vv < mn) {
          mn = vv;
          ans = 'B';
        }
      }
    }
  cout << ans;
  return 0;
}
