Two of the most mischievous Dacians in history, Danillo and Stegano, thought it would be funny to dig some tunnels that go nowhere. They knew that future historians would be extremely confused about the existence of some random tunnels and would try to speculate their purpose, but the tunnels would be, in fact, useless.
They found a huge wall in which they could start digging, but unfortunately, some patches of the wall would be unbreakable, so they would have to avoid them. The entrance to the tunnel would have to be circular for aesthetic reasons.
Formally, the wall can be described as a cartesian plane with coordinates in the range and coordinates in the range . The patches that are unbreakable are squares with sides parallel to the axes of length with corners in integer coordinates. The map of the zones that can be broken can be described by a binary matrix with lines numbered from to and columns numbered from to . If the element from line and column is , then all the points with and can be mined. Note the difference between the coordinates in the plane and the coordinates of elements in the matrix.
When mining a tunnel, the two select a point with integer coordinates as the center of the tunnel, then they select a radius , and, finally, they start digging through all the points that lie inside the disc with the center in of radius . Note that the disc includes all the points inside, not just on the boundary of the circle, and the disc must lie completely inside the defined plane.
Task
They want the tunnel to be as noticeable as possible, so they want the tunnel with the largest radius. For easier construction, if there are multiple such tunnels, they want the one that is the easiest to dig. If the center of the tunnel is in coordinates , they want the one with the smallest . If there are still multiple tunnels to choose from, they want the one with the smallest .
Input data
The first line contains two integers and in this order, defining the plane and the lengths of the binary matrix.
The following lines each contain a string of length consisting of 's and 's, denoting the elements of the matrix defined above.
Output data
On a single line, you must print three space separated integers , and . represent the coordinates of the center of the tunnel that Danillo and Stegano will dig, and represents the radius of the circle, squared and rounded to the nearest integer. If there are no circles with positive integers, you must print 0 0 0
.
Constraints and clarifications
# | Points | Constraints |
---|---|---|
0 | 0 | Examples |
1 | 4 | The matrix contains exactly four cells with . |
2 | 9 | The 's in the matrix form a rectangle with sides parallel to the axes. |
3 | 14 | |
4 | 15 | |
5 | 21 | The matrix is randomly generated. |
6 | 37 | No additional constraints |
Example 1
stdin
5 6
011110
111110
011111
111111
011110
stdout
3 2 4
Explanation
Example 2
stdin
3 3
010
101
010
stdout
0 0 0