#include <bits/stdc++.h>
using namespace std;
bool mycomp(string a, string b) { return a.size() > b.size(); }
int main() {
  int n, m;
  cin >> n >> m;
  int r, c, i, j = 0;
  string s[n], t = "";
  bool flag = true;
  for (i = 0; i < n; i++) {
    cin >> s[i];
    if (s[i].find('B') != string::npos) {
      if (flag) {
        c = (s[i].find_first_of('B') + 2 + s[i].find_last_of('B')) / 2;
        r = i + 1;
        flag = false;
      }
      j = i + 1;
    }
  }
  r = (r + j) / 2;
  cout << r << " " << c;
  return 0;
}
