B. So Easy
time limit per test
1 second
memory limit per test
512 megabytes
input
standard input
output
standard output

Mr. G invents a new game whose rules are given as follows.

Firstly, he has a $$$n \times n$$$ matrix, all elements of which are $$$0$$$ initially. Then, he follows up with some operations: in each time he chooses a row or a column, and adds an arbitrary positive integer to all the elements in the selected row or column. When all operations have been finished, he hides an element in the matrix and the element is modified to $$$-1$$$.

Now given the final matrix, you are asked to find out what the hidden element should be before the very last hiding operation.

Input

The first line contains a single integer $$$n~(2 \leq n \leq 1000)$$$.

Next $$$n$$$ lines represent the matrix after the operations. Each element in the matrix satisfies $$$-1 \leq a_{i,j} \leq 1000000$$$, and exactly one element is $$$-1$$$.

Output

Output a single integer, the hidden element.

Example
Input
3
1 2 1
0 -1 0
0 1 0
Output
1