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;
namespace baldomino {
int n, m, k;
bool ra[3630];
bool ca[3630];
const long long mod = 998244353;
long long fac[4000];
long long inv[4000];
long long degree(long long a, long long ka) {
  if (ka == 0) {
    return 1;
  }
  long long part = degree(a, ka / 2);
  part %= mod;
  long long res = (part * part) % mod;
  if (ka % 2 == 1) {
    res *= a;
    res %= mod;
  }
  return res;
}
long long inverse(long long a) { return degree(a, mod - 2); }
int main() {
  fac[0] = 1;
  inv[0] = 1;
  for (int i = 1; i <= 3640; i++) {
    long long x = fac[i - 1] * (long long)i;
    x %= mod;
    fac[i] = x;
    inv[i] = inverse(fac[i]);
  }
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m >> k;
  memset(ra, true, sizeof ra);
  memset(ca, true, sizeof ca);
  for (int i = 0; i < k; i++) {
    int r1, c1, r2, c2;
    cin >> r1 >> c1 >> r2 >> c2;
    r1--;
    c1--;
    r2--;
    c2--;
    ra[r1] = false;
    ra[r2] = false;
    ca[c1] = false;
    ca[c2] = false;
  }
  vector<int> frs;
  vector<int> fcs;
  for (int i = 0; i < n; i++) {
    if (ra[i]) {
      frs.push_back(i);
    }
  }
  for (int i = 0; i < m; i++) {
    if (ca[i]) {
      fcs.push_back(i);
    }
  }
  int x = frs.size();
  int y = fcs.size();
  if (x == 0 || y == 0) {
    cout << 1 << endl;
    return 0;
  }
  if (x <= 1 && y <= 1) {
    cout << 1 << endl;
    return 0;
  }
  long long dp1[x][x / 2 + 1];
  long long dp2[y][y / 2 + 1];
  memset(dp1, 0, sizeof dp1);
  memset(dp2, 0, sizeof dp2);
  dp1[0][0] = 1;
  for (int i = 1; i < x; i++) {
    dp1[i][0] = 1;
    for (int j = 1; j <= x / 2; j++) {
      if (frs[i] == frs[i - 1] + 1) {
        if (i == 1) {
          if (j == 1) {
            dp1[i][j] = 1;
          } else {
            dp1[i][j] = 0;
          }
        } else {
          dp1[i][j] = dp1[i - 2][j - 1];
        }
      }
      dp1[i][j] += dp1[i - 1][j];
      dp1[i][j] %= mod;
    }
  }
  dp2[0][0] = 1;
  for (int i = 1; i < y; i++) {
    dp2[i][0] = 1;
    for (int j = 1; j <= y / 2; j++) {
      if (fcs[i] == fcs[i - 1] + 1) {
        if (i == 1) {
          if (j == 1) {
            dp2[i][j] = 1;
          } else {
            dp2[i][j] = 0;
          }
        } else {
          dp2[i][j] = dp2[i - 2][j - 1];
        }
      }
      dp2[i][j] += dp2[i - 1][j];
      dp2[i][j] %= mod;
    }
  }
  long long ans = 0;
  for (int a = 0; 2 * a <= x; a++) {
    for (int b = 0; 2 * b <= y; b++) {
      if ((2 * a + b > x) || (2 * b + a > y)) {
        continue;
      }
      long long add = dp1[x - 1][a] * dp2[y - 1][b];
      add %= mod;
      add *= fac[x - 2 * a];
      add %= mod;
      add *= inv[x - 2 * a - b];
      add %= mod;
      add *= fac[y - 2 * b];
      add %= mod;
      add *= inv[y - 2 * b - a];
      add %= mod;
      ans += add;
      ans %= mod;
    }
  }
  cout << (ans + mod * 10LL) % mod << endl;
  return 0;
}
}  // namespace baldomino
int main() {
  baldomino::main();
  return 0;
}