#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, m;
  cin >> n >> m;
  vector<string> ar;
  ar.resize(n);
  for (int i = 0; i < n; i++) cin >> ar[i];
  int s_w = -1;
  int s_h = -1;
  for (int i = 0; i < n; i++) {
    bool t = false;
    for (int j = 0; j < m; j++)
      if (ar[i][j] == 'B') {
        s_w = i;
        s_h = j;
        t = true;
        break;
      }
    if (t) break;
  }
  int f_w = -1;
  int f_h = -1;
  for (int i = n - 1; i >= 0; i--) {
    bool t = false;
    for (int j = m - 1; j >= 0; j--)
      if (ar[i][j] == 'B') {
        f_w = i;
        f_h = j;
        t = true;
        break;
      }
    if (t) break;
  }
  cout << (f_w - s_w) / 2 + s_w + 1 << " " << (f_h - s_h) / 2 + s_h + 1;
  return 0;
}
