CF1692C.Where's the Bishop?

传统题 时间 2000 ms 内存 256 MiB 3 尝试 1 已通过 1 标签

Where's the Bishop?

Mihai has an 8×88 \times 8 chessboard whose rows are numbered from 11 to 88 from top to bottom and whose columns are numbered from 11 to 88 from left to right.

Mihai has placed exactly one bishop on the chessboard. The bishop is not placed on the edges of the board. (In other words, the row and column of the bishop are between 22 and 77, inclusive.)

The bishop attacks in all directions diagonally, and there is no limit to the distance which the bishop can attack. Note that the cell on which the bishop is placed is also considered attacked.

An example of a bishop on a chessboard. The squares it attacks are marked in red.

Mihai has marked all squares the bishop attacks, but forgot where the bishop was! Help Mihai find the position of the bishop.

Input

The first line of the input contains a single integer tt (1t361 \leq t \leq 36) — the number of test cases. The description of test cases follows. There is an empty line before each test case.

Each test case consists of 88 lines, each containing 88 characters. Each of these characters is either '#' or '.', denoting a square under attack and a square not under attack, respectively.

Output

For each test case, output two integers rr and cc (2r,c72 \leq r, c \leq 7) — the row and column of the bishop.

The input is generated in such a way that there is always exactly one possible location of the bishop that is not on the edge of the board.

Note

The first test case is pictured in the statement. Since the bishop lies in the intersection row 44 and column 33, the correct output is 4 3.

Samples

3

.....#..
#...#...
.#.#....
..#.....
.#.#....
#...#...
.....#..
......#.

#.#.....
.#......
#.#.....
...#....
....#...
.....#..
......#.
.......#

.#.....#
..#...#.
...#.#..
....#...
...#.#..
..#...#.
.#.....#
#.......
4 3
2 2
4 5

在线编程 IDE

建议全屏模式获得最佳体验