Given an $n \times n$ binary matrix $c$, find the number of binary sequences $a$ and $b$ of length $n$ such that $c_{i,j} = a_i \lor b_j$ for all $1 \le i, j \le n$. Output the answer modulo $998\,244\,353$.
Input
The first line contains an integer $n$, representing the size of the matrix.
The next $n$ lines each contain a binary string of length $n$, where the $j$-th character of the $i$-th string represents $c_{i,j}$.
Output
Output a single integer representing the answer modulo $998\,244\,353$.
Constraints
Subtask 1 (5 points): $n \le 10$
Subtask 2 (15 points): $n \le 20$
Subtask 3 (40 points): $n \le 300$
Subtask 4 (5 points): Matrix $c$ is random.
Subtask 5 (35 points): No additional constraints.
$1 \le n \le 5000, 0 \le c_{i,j} \le 1$
Examples
Input 1
3 010 101 010
Output 1
2