125. Shtirlits

time limit per test: 0.25 sec.
memory limit per test: 4096 KB

There is a checkered field of size N x N cells (1 Ј N Ј 3). Each cell designates the territory of a state (i.e. N2 states). Each state has an army. Let A [i, j] be the number of soldiers in the state which is located on i-th line and on j-th column of the checkered field (1£i£N, 1£j£N, 0 £  A[i, j] £  9). For each state the number of neighbors, B [i, j], that have a larger army, is known. The states are neighbors if they have a common border (i.e. £  B[i, j]  £  4). Shtirlits knows matrix B. He has to determine the number of armies for all states (i.e. to find matrix A) using this information for placing forces before the war. If there are more than one solution you may output any of them.


The first line contains a natural number N. Following N lines contain the description of matrix B - N numbers in each line delimited by spaces.


If a solution exists, the output file should contain N lines, which describe matrix A. Each line will contain N numbers delimited by spaces. If there is no solution, the file should contain NO SOLUTION.

Sample Input

1 2 1
1 2 1
1 1 0

Sample Output

1 2 3
1 4 5
1 6 7

Author: Victor G. Samoilov, Herman "Smash" Narkaytis
Resource: 5th Southern Subregional Contest. Saratov 2002
Date: 2002-10-10