시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 256 MB 0 0 0 0.000%

문제

Square raster image is represented by an array of $N \times N$ pixels. A texture tile is a square image in which the first row is equal to the last one, and the first column is equal to the last one. This property is valuable when covering the surface of graphics object with repeating copies of texture, because it allows "seamless" transitions between tiles.

Your program must, given an image, find its largest subimage which is a texture tile.

입력

Input file contains integer $N$ followed by $N^2$ numbers $c_{i, j}$ -- pixel values. 

출력

Output file must contain numbers $p$ $q$ $m$ -- coordinates of top left corner and size of the largest texture tile. If several solutions exist, output any of them.

제한

  • $1 \le N \le 370$, $0 \le c_{i, j} \le 255$

예제 입력 1

2
0 0
2 3

예제 출력 1

1 1 1

예제 입력 2

4
1 0 0 0
1 2 5 2
1 0 0 0
4 4 4 4

예제 출력 2

1 2 3