#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ;
  string s;
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> s;
    int h = 0;
    while (s[h] != 'B' and h <= m) h++;
    int c = count(s.begin(), s.end(), 'B');
    if (c > 0) {
      cout << i + c / 2 + 1 << " " << h + c / 2 + 1;
      break;
    }
  }
}
