#include <bits/stdc++.h>
using namespace std;
long long n, m, i, j, k, l, a[101010], b[101010], xa, xb, ya, yb;
vector<long long> q[3030];
char s[1010][1010];
int main() {
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      cin >> s[i][j];
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      if (s[i][j] == 'B') {
        xa = i;
        ya = j;
        break;
      }
    }
  }
  for (i = n; i >= 1; i--) {
    for (j = m; j >= 1; j--) {
      if (s[i][j] == 'B') {
        xb = i;
        yb = j;
        break;
      }
    }
  }
  cout << (xa + xb) / 2 << " " << (ya + yb) / 2;
}
