A farm is divided into n×n unit squares of n rows and n columns. Let's define (i,j) as the unit square in the i-th row and the j-th column (1≤i≤n, 1≤j≤n).
The distance between two squares (i_1,j_1) and (i_2,j_2) is defined to be d((i_1,j_1),(i_2,j_2))=∣i_1−i_2∣+∣j_1−j_2∣, the Manhattan distance between those two squares.
There are automatic sprayers on this farm that spray fertilizer solution or herbicide so that the owner can produce grain efficiently.
Each sprayer lies entirely in a unit square. The sprayer in (x,y) sprays A_x,y liters of solution to all unit squares. A_x,y can be any nonnegative integer.
The energy required for the sprayer in (x,y) to spray solution to (i,j) is exactly d((x,y),(i,j))×A_x,y. For each square (i,j), we compute E_i,j, the sum of energies needed for all sprayers to spray the square (i,j).
Given the matrix E, write a program that generates any possible matrix A that corresponds to matrix E. E will be given such that there exists such a matrix A of nonnegative integers whose sum is at most 1012.
The first line contains a single positive integer n (2≤n≤1,000).
The next n lines each contain n integers. The j-th (1≤j≤n) integer in the i-th (1≤i≤n) line is E_i,j (0≤E_i,j≤1016).
The input is designed such that a matrix A consisting of only non-negative integers whose sum is at most 1012 exists which can yield E.
Output n lines, each containing n integers. The y-th (1≤y≤n) integer in the x-th (1≤x≤n) line should be A_x,y.