#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const double PI = acos(-1.0);
int n, m;
char a[555][555];
int x, y, v, u;
char ch;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> ch;
      if (ch == 'B' && !x) {
        x = i, y = j;
      }
      if (ch == 'B') {
        v = i, u = j;
      }
    }
  }
  cout << (v + x) / 2 << " " << (u + y) / 2;
}
