Robinson#8703

Robinson

1 second
64 megabytes
Easy

Robinson has finally downloaded a photo of his island from the Internet and is ready to build a hut on the southern coast. The island is surrounded by the ocean and contains internal water bodies. The photo is represented as a rectangular matrix of size × , where each cell is either (water) or (land). Robinson's current dwelling is located at coordinates , . Your task is to help Robinson select a cell , on the southern coast to construct his new hut, ensuring that the travel time between the two huts is minimized. If multiple cells meet this criterion, you only need to provide one of them. Robinson can move between adjacent cells that share a side, spending hour on a land cell and hours on a water cell (including the first and last cells of the journey). A cell on the southern coast is defined as the last in each column of the matrix.

ris1.jpg

Input

The first line contains the integers , , , — natural numbers, each not exceeding . The following lines each contain numbers, either or .

Output

The first line should contain — the minimum travel time between the huts. The second line should contain the coordinates , of the new hut on the southern coast.

Examples

Example 1

Loading
Loading