Reverse Averaging#3692

Reverse Averaging

1 second
256 megabytes
Very hard

One of the common tasks in image processing is averaging. Consider a set of numbers u_{i,j} representing image brightness, where i, j = 0, 1, \ldots, n-1. Averaging involves calculating the values:

v_{i,j} = 5u_{i,j} + u_{i-1,j} + u_{i,j-1} + u_{i,j+1} + u_{i+1,j}.

The indices are taken modulo . Given a set of numbers v_{i,j}, your task is to restore the original values u_{i,j}.

Input

The first line contains the integer 2 \leq n \leq 100. The following lines each contain integers, where -10 \leq v_{i,j} \leq 10.

Output

Output lines, each containing numbers, representing the restored set u_{i,j}. The numbers should be output with a precision of at least 10^{-9}.

Examples

Example 1

Loading
Loading