#include <bits/stdc++.h>
int main() {
  int m, n;
  scanf("%d", &m);
  scanf("%d", &n);
  char arr[m][n];
  int row, col;
  char B;
  for (row = 0; row < m; row++) {
    for (col = 0; col < n; col++) {
      scanf(" %c", &arr[row][col]);
    }
  }
  int lastrow = -1;
  int lastcol = -1;
  int found = -1;
  int firstrow = -1;
  int firstcol = -1;
  for (row = 0; row < m; row++) {
    for (col = 0; col < n; col++) {
      if (arr[row][col] == 'B') {
        firstrow = row;
        firstcol = col;
        found = 1;
        break;
      }
    }
    if (found == 1) {
      break;
    }
  }
  firstrow = firstrow + 1;
  firstcol = firstcol + 1;
  printf("\n");
  for (row = 0; row < m; row++) {
    for (col = 0; col < n; col++) {
      if (arr[row][col] == 'B') {
        lastrow = row;
        lastcol = col;
      }
    }
  }
  lastrow = lastrow + 1;
  lastcol = lastcol + 1;
  printf("%d %d", (firstrow + lastrow) / 2, (firstcol + lastcol) / 2);
}
