Window

No attempts yetTime limit8sMemory limit256 MB

Problem

A square wall of size N×NN \times N is filled with N2/2N^2/2 bricks of size 2×12 \times 1, packed with no gaps. NN is even. The bricks are numbered from 1 to N2/2N^2/2. Some of them lie horizontally and the rest lie vertically. The wall has no empty cell. Two cells carrying the same number form one brick.

You cut a square hole in the wall to fit a window. The hole must satisfy all of the following.

  1. The sides of the hole are parallel to the sides of the wall.
  2. The hole does not touch any border of the wall, so the whole hole lies inside the wall.
  3. Cutting the hole must not break a brick, so the border of the hole runs only along brick borders.

Write a program that finds a square hole with the longest side among those that satisfy the conditions. At least one such hole is guaranteed to exist.

Input

The first line contains the side length NN of the wall. NN is even and 4N2004 \le N \le 200.

Each of the next NN lines contains NN integers describing the brick layout. Each integer is between 1 and N2/2N^2/2, every value appears exactly twice, and the two cells with the same value are adjacent.

Output

On the first line print the side length of the square hole, then the row number and the column number of its upper left cell, separated by spaces. The upper left cell of the wall is (1,1)(1, 1).

If several holes share the longest side, print the one with the smallest row number. If several of those remain, print the one with the smallest column number among them.

Hint

In the example the longest square hole has side 2. Removing bricks 6 and 7 works, and removing bricks 10 and 11 works as well, but the answer is (3,2)(3, 2) because its row number is smaller.