#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  char a[n][m];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) cin >> a[i][j];
  }
  int s1 = 0, s2 = 0, s3 = 0, s4 = 0, l = 0, s5 = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (a[i][j] == 'B') {
        s1 = i + 1;
        s2 = j + 1;
        s4 = 1;
        break;
      }
      if (s4 == 1) break;
    }
  }
  for (int j = n - 1; j >= 0; j--) {
    for (int i = 0; i < m; i++) {
      if (a[j][i] == 'B') {
        s3 = j + 1;
        l = 1;
        break;
      }
      if (l == 1) break;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (a[i][j] == 'B') {
        s5 = j + 1;
      }
    }
  }
  cout << (s3 + s1) / 2 << " " << (s2 + s5) / 2 << endl;
}
