#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  cin >> a;
  int c;
  cin >> c;
  int start_x = -1;
  int start_y = -1;
  int end_x = -1;
  int end_y = -1;
  int f = 0;
  for (int j = 0; j < a; j++) {
    string b;
    cin >> b;
    if (f == 0) {
      for (int i = 0; i < b.length(); i++) {
        if (b[i] == 'B' && f == 0) {
          start_x = j;
          start_y = i;
          end_x = start_x;
          end_y = start_y;
          f = 1;
        } else if (b[i] == 'B' && f == 1) {
          end_x = j;
          end_y = i;
        }
      }
    }
  }
  int size = end_y - start_y + 1;
  int ans_y = (start_y + end_y) / 2;
  int ans_x = start_x + (size / 2);
  cout << ans_x + 1 << " " << ans_y + 1 << endl;
  return 0;
}
