#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  string s[n];
  int i, j, arr[n * m], arr1[n * m], k = 0;
  for (i = 0; i < n; i++) {
    cin >> s[i];
    for (j = 0; j < m; j++) {
      if (s[i][j] == 'B') {
        arr[k] = i + 1;
        arr1[k] = j + 1;
        k++;
      }
    }
  }
  cout << (arr[0] + arr[k - 1]) / 2 << ' ' << (arr1[0] + arr1[k - 1]) / 2;
  return 0;
}
