J. Grid Product
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

You are given a rectangular grid $$$B$$$ with $$$N$$$ rows and $$$M$$$ columns. Consider some rectangular grid $$$A$$$ with $$$N$$$ rows and $$$M$$$ columns. $$$A$$$ is considered mediocre if $$$A_{i, j}$$$ is an integer and $$$0 \leq A_{i, j} \leq B_{i, j}$$$ for all $$$(i, j)$$$.

Let $$$F(A) = \displaystyle\left(\prod_{i = 1}^{N}\left(\sum_{j = 1}^{M}A_{i, j}\right)\right) \displaystyle\left(\prod_{j = 1}^{M}\left(\sum_{i = 1}^{N}A_{i, j}\right)\right)$$$.

Calculate the sum of $$$F(A)$$$ over all mediocre $$$A$$$ modulo $$$998244353$$$.

Input

The first line contains two positive integers $$$N$$$ and $$$M$$$ $$$(1 \leq N \cdot M \leq 300)$$$.

Each of the next $$$N$$$ lines contains $$$M$$$ integers $$$B_{i, j}$$$ $$$(0 \leq B_{i, j} \leq 10^9)$$$.

There are $$$20$$$ tests, not including samples. Each test is worth $$$\frac{100}{20}=5$$$ points.

Tests $$$1 - 2$$$ satisfy $$$N = 1$$$.

Tests $$$3 - 12$$$ satisfy $$$N \cdot M \leq 100$$$.

The remaining tests do not satisfy any additional constraints.

Output

Print one integer — the sum of $$$F(A)$$$ over all mediocre $$$A$$$ modulo $$$998244353$$$.

Examples
Input
1 3
1 2 1
Output
11
Input
2 2
1 1
0 1
Output
5
Input
2 3
1 1 1
1 1 1
Output
312
Input
3 3
69 420 37
666 777 888
998244353 123456789 987654321
Output
57820980
Note

Problem Idea: HaccerKat

Problem Preparation: HaccerKat

Occurrences: Advanced J