Problem: Consider a square grid with h rows and w columns with some dominoes on it. Each domino covers exactly two cells of the grid that share a common side. Every cell is covered by at most one domino.

Let's call a placement of dominoes on the grid perfectly balanced if no row and no column contains a pair of cells covered by two different dominoes. In other words, every row and column may contain no covered cells, one covered cell, or two covered cells that belong to the same domino.

You are given a perfectly balanced placement of dominoes on a grid. Find the number of ways to place zero or more extra dominoes on this grid to keep the placement perfectly balanced. Output this number modulo 998 244 353.

Input

The first line contains three integers h, w, and n (1 ≤ h, w ≤ 3600; 0 ≤ n ≤ 2400), denoting the dimensions of the grid and the number of already placed dominoes. The rows are numbered from 1 to h, and the columns are numbered from 1 to w.

Each of the next n lines contains four integers r_{i, 1}, c_{i, 1}, r_{i, 2}, c_{i, 2} (1 ≤ r_{i, 1} ≤ r_{i, 2} ≤ h; 1 ≤ c_{i, 1} ≤ c_{i, 2} ≤ w), denoting the row id and the column id of the cells covered by the i-th domino. Cells (r_{i, 1}, c_{i, 1}) and (r_{i, 2}, c_{i, 2}) are distinct and share a common side.

The given domino placement is perfectly balanced.

Output

Output the number of ways to place zero or more extra dominoes on the grid to keep the placement perfectly balanced, modulo 998 244 353.

Examples

Input


5 7 2
3 1 3 2
4 4 4 5


Output


8


Input


5 4 2
1 2 2 2
4 3 4 4


Output


1


Input


23 42 0


Output


102848351

Note

In the first example, the initial grid looks like this:

<image>

Here are 8 ways to place zero or more extra dominoes to keep the placement perfectly balanced:

<image>

In the second example, the initial grid looks like this:

<image>

No extra dominoes can be placed here.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int N = (int)4005, mod = (int)998244353;
int f[N], inv[N], banr[N], banw[N], dpr[N][3], dpw[N][3];
int comb(int n, int r) {
  if (n == r) return 1;
  if (r < 0 || n < 0 || n - r < 0) return 0;
  return f[n] * (long long)inv[r] % mod * inv[n - r] % mod;
}
int pw(int a, int b) {
  if (b == 0) return 1;
  return (long long)pw((long long)a * a % mod, b >> 1) * (b & 1 ? a : 1) % mod;
}
int main() {
  inv[0] = f[0] = 1;
  for (int j = 1; j < N; ++j)
    f[j] = (long long)f[j - 1] * j % mod, inv[j] = pw(f[j], mod - 2);
  int n, m, q;
  cin >> n >> m >> q;
  while (q--) {
    int x0, y0, x1, y1;
    cin >> x0 >> y0 >> x1 >> y1;
    --x0, --y0, --x1, --y1;
    banr[x0] = banr[x1] = 1;
    banw[y0] = banw[y1] = 1;
  }
  dpr[0][2] = 1;
  for (int j = 0; j < n; ++j) {
    for (int i = 0; i < N; ++i)
      dpr[i][0] = dpr[i][1], dpr[i][1] = dpr[i][2], dpr[i][2] = 0;
    for (int i = 0; i <= n; ++i) {
      dpr[i][2] = dpr[i][1];
      if (j > 0 && i > 0 && !banr[j] && !banr[j - 1]) {
        dpr[i][2] = (dpr[i][2] + dpr[i - 1][0]) % mod;
      }
    }
  }
  dpw[0][2] = 1;
  for (int j = 0; j < m; ++j) {
    for (int i = 0; i < N; ++i)
      dpw[i][0] = dpw[i][1], dpw[i][1] = dpw[i][2], dpw[i][2] = 0;
    for (int i = 0; i <= m; ++i) {
      dpw[i][2] = dpw[i][1];
      if (j > 0 && i > 0 && !banw[j] && !banw[j - 1]) {
        dpw[i][2] = (dpw[i][2] + dpw[i - 1][0]) % mod;
      }
    }
  }
  int haver = 0, havew = 0;
  for (int j = 0; j < n; ++j) haver += !banr[j];
  for (int j = 0; j < m; ++j) havew += !banw[j];
  int res = 0;
  for (int user = 0; user * 2 <= haver; ++user) {
    for (int usew = 0; usew * 2 <= havew; ++usew) {
      int ways = (long long)dpr[user][2] * dpw[usew][2] % mod;
      if (!ways) continue;
      int remr = haver - user * 2;
      int remw = havew - usew * 2;
      if (user > remw || usew > remr) continue;
      ways = (long long)ways * comb(remw, user) % mod * f[user] % mod *
             comb(remr, usew) % mod * f[usew] % mod;
      res = (res + ways) % mod;
    }
  }
  cout << res << '\n';
}