atcoder#ABC305C. [ABC305C] Snuke the Cookie Picker
[ABC305C] Snuke the Cookie Picker
Score : points
Problem Statement
There is a grid with rows and columns. Let denote the square at the -th row from the top and the -th column from the left. Initially, there was one cookie on each square inside a rectangle whose height and width were at least 2 squares long, and no cookie on the other squares. Formally, there was exactly one quadruple of integers that satisfied all of the following conditions.
- There was one cookie on each square such that , and no cookie on the other squares.
However, Snuke took and ate one of the cookies on the grid. The square that contained that cookie is now empty.
As the input, you are given the state of the grid after Snuke ate the cookie.
The state of the square is given as the character , where #
means a square with a cookie, and .
means a square without one.
Find the square that contained the cookie eaten by Snuke. (The answer is uniquely determined.)
Constraints
- is
#
or.
.
Input
The input is given from Standard Input in the following format:
Output
Let the square contained the cookie eaten by Snuke. Print and in this order, separated by a space.
5 6
......
..#.#.
..###.
..###.
......
2 4
Initially, cookies were on the squares inside the rectangle with as the top-left corner and as the bottom-right corner, and Snuke ate the cookie on . Thus, you should print .
3 2
#.
##
##
1 2
Initially, cookies were placed on the squares inside the rectangle with as the top-left corner and as the bottom-right corner, and Snuke ate the cookie at .
6 6
..####
..##.#
..####
..####
..####
......
2 5