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;
bool chkmax(int &x, int y) { return x < y ? x = y, true : false; }
bool chkmin(int &x, int y) { return x > y ? x = y, true : false; }
int readint() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
const int cys = 998244353;
long long mod(long long x) { return x >= cys ? x - cys : x; }
struct node {
  int n;
  long long res[3605];
  node() {
    n = 0;
    memset(res, 0, sizeof(res));
  }
  node operator*(const node c) const {
    node ret;
    ret.n = n + c.n;
    for (int i = 0; i <= n; i++)
      for (int j = 0; j <= c.n; j++)
        ret.res[i + j] = mod(ret.res[i + j] + res[i] * c.res[j] % cys);
    return ret;
  }
} ansx, ansy, d[3605];
int n, m, k;
long long fac[3605], inv[3605];
bool vx[3605], vy[3605];
long long qpow(long long x, long long p) {
  long long ret = 1;
  for (; p; p >>= 1, x = x * x % cys)
    if (p & 1) ret = ret * x % cys;
  return ret;
}
int main() {
  n = readint();
  m = readint();
  k = readint();
  fac[0] = inv[0] = 1;
  for (int i = 1; i <= max(n, m); i++) fac[i] = fac[i - 1] * i % cys;
  inv[max(n, m)] = qpow(fac[max(n, m)], cys - 2);
  for (int i = max(n, m) - 1; i >= 1; i--) inv[i] = inv[i + 1] * (i + 1) % cys;
  int x1, y1, x2, y2;
  vx[0] = vy[0] = vx[n + 1] = vy[m + 1] = 1;
  for (int i = 1; i <= k; i++) {
    x1 = readint();
    y1 = readint();
    x2 = readint();
    y2 = readint();
    vx[x1] = vx[x2] = 1, vy[y1] = vy[y2] = 1;
  }
  d[0].res[0] = 1;
  for (int i = 1; i <= max(n, m); i++) d[i].n = i / 2;
  for (int i = 1; i <= max(n, m); i++)
    for (int j = 0; j <= i / 2; j++)
      d[i].res[j] =
          mod(d[i - 1].res[j] + (i > 1 && j ? d[i - 2].res[j - 1] : 0));
  int lst = 0;
  ansx.res[0] = ansy.res[0] = 1;
  for (int i = 1; i <= n + 1; i++) {
    if (vx[i] && lst != i - 1) ansx = ansx * d[i - lst - 1];
    if (vx[i]) lst = i;
  }
  lst = 0;
  for (int i = 1; i <= m + 1; i++) {
    if (vy[i] && lst != i - 1) ansy = ansy * d[i - lst - 1];
    if (vy[i]) lst = i;
  }
  int kxn = 0, kxm = 0;
  for (int i = 1; i <= n; i++)
    if (!vx[i]) kxn++;
  for (int i = 1; i <= m; i++)
    if (!vy[i]) kxm++;
  long long ans = 0;
  for (int i = 0; i <= kxn; i++) {
    for (int j = 0; j <= kxm; j++) {
      if ((i + i - j) % 3 != 0) continue;
      int ln = (i + i - j) / 3, lm = i - 2 * ln;
      if (lm < 0 || ln < 0) continue;
      ans =
          mod(ans + ansx.res[ln] * ansy.res[lm] % cys * fac[kxn - 2 * ln] %
                        cys * inv[kxn - 2 * ln - lm] % cys * fac[kxm - 2 * lm] %
                        cys * inv[kxm - 2 * lm - ln] % cys);
    }
  }
  cout << ans << endl;
  return 0;
}