#include <bits/stdc++.h>
using namespace std;
char s[130][130];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int ansx = -1, ansy = -1, xflg = 0, xsta = 130;
  for (int i = 1; i <= n + 1; i++) {
    scanf("%s", s[i] + 1);
    int flg = 0, ysta = 130;
    for (int j = 1; j <= m + 1; j++) {
      if (s[i][j] == 'B') {
        flg = 1;
        ysta = min(ysta, j);
        xsta = min(xsta, i);
      } else {
        if (flg == 1) {
          ansy = (j + ysta) / 2;
          break;
        }
      }
    }
    if (flg == 0) {
      if (xflg == 1) {
        ansx = (i + xsta) / 2;
        break;
      }
    } else
      xflg = 1;
  }
  cout << ansx << " " << ansy << endl;
}
