You are given the last n - 1 rows of an n \times n boolean matrix . Your task is to determine boolean values for the first row such that r = (\det(A) \pmod{100003}) is maximized (see notes). You only need to output the value of .
The first line contains integer n~(2 \leq n \leq 400).
Lines through contain numbers each: -th line containing the numbers (either or ) in the -th row of .
Output non-negative integer r~(0 \le r < 100003) on the single line.
Example 1
Example 2
is a boolean matrix iff A_{i,j} \in \lbrace 0, 1\rbrace, \forall A_{i, j} \in A
\det(A) = \begin{cases} A_{1,1} \qquad &\text{if }\ n = 1 \\ \sum_j(-1)^{1+j}A_{1,j}\det(M_{1,j})&\text{if }\ n > 1 \end{cases}
Where M_{i,j} is the matrix obtained from by deleting the row and column containing A_{i,j}
X \pmod B = The remainder of division of by .