#abc269b. [abc269_b]Rectangle Detection
[abc269_b]Rectangle Detection
Problem Statement
Takahashi generated strings as follows.
- First, let
..........
(.
s in a row). - Next, choose four integers , , , and satisfying all of the following.
- .
- .
- Then, for every pair of integers satisfying all of the following, replace the -th character of with
#
.- .
- .
You are given generated as above. Find the integers , , , and Takahashi chose.
It can be proved that such integers , , , and uniquely exist (there is just one answer) under the Constraints.
Constraints
- are strings, each of length , that can be generated according to the Problem Statement.
Input
The input is given from Standard Input in the following format:
Output
Print the answer in the following format:
Sample Input 1
..........
..........
..........
..........
...######.
...######.
...######.
...######.
..........
..........
Sample Output 1
5 8
4 9
Here, Takahashi chose , , , .
This choice generates strings , each of length , where the -th through -th characters of are #
, and the other characters are .
.
These are equal to the strings given in the input.
Sample Input 2
..........
..#.......
..........
..........
..........
..........
..........
..........
..........
..........
Sample Output 2
2 2
3 3
Sample Input 3
##########
##########
##########
##########
##########
##########
##########
##########
##########
##########
Sample Output 3
1 10
1 10