#include <bits/stdc++.h>
using namespace std;
const int MX = 1147483646;
const long long MX2 = 3223372036854775800;
const int MOD = 1000000007;
int main() {
  cin.tie(NULL);
  cout.tie(0);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  int i, j;
  string s[1000];
  int sy, sx;
  int ey, ex;
  bool f = 0;
  for (i = 1; i <= n; i++) {
    cin >> s[i];
    for (j = 0; j < m; j++) {
      if (s[i][j] == 'B' && f == 0) {
        sy = i;
        sx = j + 1;
        f = 1;
      }
    }
  }
  f = 0;
  for (i = n; i >= 1; i--) {
    for (j = m - 1; j >= 0; j--) {
      if (s[i][j] == 'B' && f == 0) {
        ey = i;
        ex = j + 1;
        f = 1;
      }
    }
  }
  cout << (sy + ey) / 2 << " " << (sx + ex) / 2;
  return 0;
}
