Consider a table of size n × m, initially fully white. Rows are numbered 1 through n from top to bottom, columns 1 through m from left to right. Some square inside the table with odd side length was painted black. Find the center of this square.

Input

The first line contains two integers n and m (1 ≤ n, m ≤ 115) — the number of rows and the number of columns in the table.

The i-th of the next n lines contains a string of m characters s_{i1} s_{i2} … s_{im} (s_{ij} is 'W' for white cells and 'B' for black cells), describing the i-th row of the table.

Output

Output two integers r and c (1 ≤ r ≤ n, 1 ≤ c ≤ m) separated by a space — the row and column numbers of the center of the black square.

Examples

Input

5 6
WWBBBW
WWBBBW
WWBBBW
WWWWWW
WWWWWW


Output

2 4


Input

3 3
WWW
BWW
WWW


Output

2 1
"""Find Square.

https://codeforces.com/contest/1028/problem/A

Consider a table of size `n * m`, initially fully white. Rows are
numbered `1` through `n` from top to bottom, columns `1` through `m` from left
to right. Some square inside the table with odd side length was painted black.
Find the center of this square.

Input:

The first line contains two integers `n` and `m` (`1 <= n, m <= 115`) - the
number of rows and the number of columns in the table.

The `i-th` of the next `n` lines contains a string of `m` characters `s_{i1}
s_{i2} ... s_{im}` (`s_{ij}` is 'W' for white cells and 'B' for black cells),
describing the `i-th` row of the table.

Output:

Output two integers `r` and `c` (`1 <= r <= n`, `1 <= c <= m`) separated by a
space - the row and column numbers of the center of the black square.

"""
import logging


fmt = '%(levelname)s - %(name)s (line:%(lineno)s) - %(message)s'
formatter = logging.Formatter(fmt)

ch = logging.StreamHandler()
ch.setLevel(logging.ERROR)
ch.setFormatter(formatter)

logger = logging.getLogger('find_square')
logger.setLevel(logging.ERROR)
logger.addHandler(ch)


def solve(table, n, m):
    if n == m == 1:
        return (1, 1)

    first = None
    second = None
    for row, row_values in enumerate(table):
        if second is not None:
            break
        for col, value in enumerate(row_values):
            if value == 'B' and first is None and col + 1 != m:
                first = (row, col)
            elif value == 'B' and first is None and col + 1 == m:
                first = second = (row, col)
            elif first is not None and value == 'W':
                second = (row, col - 1)
            elif first is not None and col + 1 == m:
                second = (row, col - 1)
            if second is not None:
                break

    last = None
    for row in range(first[0], n):
        row_values = table[row]
        if last is not None:
            break
        col, value = first[1], table[row][first[1]]
        if value == 'W':
            last = (row - 1, col)
        elif row + 1 == n:
            last = (row, col)

    num_cols = second[1] - first[1] + 1
    num_rows = last[0] - first[0] + 1
    if num_rows > num_cols:
        second = second[0], second[1] + (num_rows - num_cols)
    elif num_rows < num_cols:
        last = last[0] - (num_cols - num_rows), last[1]
    
    center_row = (first[0] + 1 + last[0] + 1) // 2
    center_col = (first[1] + 1 + second[1] + 1) // 2

    return center_row, center_col


def main():
    n, m = map(int, input().strip().split())
    table = [list(input().strip()) for _ in range(n)]        

    result = solve(table, n, m)
    print(' '.join(map(str, result)))


if __name__ == '__main__':
    main()
