#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  char s[n][m];
  int a, b, c, d;
  bool hell = false, cell = false;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> s[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (s[i][j] == 'B') {
        a = i;
        b = j;
        hell = true;
        break;
      }
    }
    if (hell) break;
  }
  for (int i = n - 1; i >= 0; i--) {
    for (int j = m - 1; j >= 0; j--) {
      if (s[i][j] == 'B') {
        c = i;
        d = j;
        cell = true;
        break;
      }
    }
    if (cell) break;
  }
  cout << (a + c + 2) / 2 << " " << (b + d + 2) / 2 << endl;
  return 0;
}
