PCK is participating in the World Robot Challenge in the Disaster Response Simulation category. The mission of this category is to rescue people who are stranded in a building.
The interior of the building is represented by a plane divided into $H$ rows and $W$ columns, where each square is either a wall, a path, or an obstacle. There are $N$ people left in the building, and each of the $N$ rescue robots rescues one person at a time. All the robots leave from one base station at once, and each goes to the person to be rescued. Each robot can move to the adjacent squares in the same row and column from its current position, but cannot move to squares outside of buildings or walls. The path and obstacle squares can be occupied by multiple robots at the same time. If a robot enters an obstacle square, it will take 1 damage.
The first task for PCK to accomplish the mission is to select a suitable location for the base station where he can rescue all the people who are stranded. Whenever there is a path for the robots to reach the location of the people from the base station, you can always choose the path that minimizes the damage the robots will take. Based on this assumption, we decided to look for the base station that would have the smallest maximum value of damage suffered by each robot. However, the base station must be placed in a square that represents a path, but it can be placed even if there is a person in that square.
Given information about the inside of a building and the location of a person, create a program that selects the location of a base station and reports one candidate.
The input is given in the following format.
$H$ $W$ $N$ $s_{1,1}s_{1,2}$...$s_{1,W}$ $s_{2,1}s_{2,2}$...$s_{2,W}$ : $s_{H,1}s_{H,2}$...$s_{H,W}$ $r_1$ $c_1$ $r_2$ $c_2$ : $r_N$ $c_N$
In the first line, the number of rows $H$ ($2 \leq H \leq 300$) and the number of columns $W$ ($2 \leq W \leq 300$) of the plane representing the interior of the building, and the number of people $N$ ($ 1 \leq N \leq 300$) are given. The letters $s_{i,j}$ representing the squares in row $i$ and column $j$ are given in the subsequent $H$ lines. If $s_{i,j}$ is '. ', '
Outputs a pair of integers representing the location of the base station on a single line, separated by spaces. If there are multiple candidates, output the one with the smallest row number. If there are multiple such candidates, output the one with the smallest column number. However, if there are no candidates, output "-1 -1".
3 4 2 .@.# #.@@ .@.. 1 1 3 4
1 3
2 6 2 #.@@.# ###### 1 2 1 5
1 2
3 3 2 ... ### ... 1 1 3 3
-1 -1