410430: GYM104021 B So Easy
Description
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.
InputThe 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$$$.
OutputOutput a single integer, the hidden element.
ExampleInput3 1 2 1 0 -1 0 0 1 0Output
1