#include <bits/stdc++.h>
using namespace std;
void solve() {
  int i, j, n, m, loc1, loc2, loc3, loc4, x, y;
  cin >> n >> m;
  char a[n][m];
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) cin >> a[i][j];
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      if (a[i][j] == 'B') loc1 = i + 1;
    }
  }
  for (i = n - 1; i >= 0; i--) {
    for (j = 0; j < m; j++) {
      if (a[i][j] == 'B') {
        loc2 = i + 1;
        break;
      }
    }
  }
  for (i = 0; i < n; i++) {
    for (j = m - 1; j >= 0; j--) {
      if (a[i][j] == 'B') loc3 = j + 1;
    }
  }
  for (i = n - 1; i >= 0; i--) {
    for (j = m - 1; j >= 0; j--) {
      if (a[i][j] == 'B') {
        loc4 = j + 1;
        break;
      }
    }
  }
  x = (loc1 + loc2) / 2;
  y = (loc3 + loc4) / 2;
  cout << x << " " << y << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  solve();
  return 0;
}
