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 long long int INF = 9223372036854775807;
const long long int mod = 998244353;
int MOD(int a, int b) {
  if (a > b)
    return a - b;
  else
    return b - a;
}
long long int max3(long long int a, long long int b, long long int c) {
  return max(c, max(a, b));
}
long long int min3(long long int a, long long int b, long long int c) {
  return min(a, min(b, c));
}
long long int power(long long int x, long long int y, long long int mod1) {
  long long int res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x) % mod1;
    y = y >> 1;
    x = (x * x) % mod1;
  }
  return res;
}
long long int logg(long long int a) {
  long long int x = 0;
  while (a > 1) {
    x++;
    a /= 2;
  }
  return x;
}
long long int gcd(long long int a, long long int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long int abso(long long int x) {
  if (x < 0) {
    return -x;
  }
  return x;
}
long long int ceiling(long long int a, long long int b) {
  if (a % b == 0) {
    return a / b;
  } else {
    return a / b + 1;
  }
}
long long int modinv(long long int x, long long int p) {
  return power(x, p - 2, p);
}
struct point {
  long long int x;
  long long int y;
};
long long int cross(point a, point b) { return a.x * b.y - b.x * a.y; }
bool ccw(point p1, point p2) {
  if (cross(p1, p2) > 0) {
    return true;
  } else {
    return false;
  }
}
void ccw_sort(vector<point> &v) {
  vector<point> v1, v2;
  for (int i = 0; i < v.size(); i++) {
    if (v[i].y > 0) {
      v1.push_back(v[i]);
    } else {
      v2.push_back(v[i]);
    }
  }
  sort(v1.begin(), v1.end(), ccw);
  sort(v2.begin(), v2.end(), ccw);
  for (int i = 0; i < v2.size(); i++) {
    v1.push_back(v2[i]);
  }
  v = v1;
}
int main() {
  long long int h, w, n;
  cin >> h >> w >> n;
  vector<long long int> chr(h + 1);
  vector<long long int> chc(w + 1);
  for (int i = 0; i < n; i++) {
    int r1, c1, r2, c2;
    cin >> r1 >> c1 >> r2 >> c2;
    chr[r1] = chr[r2] = 1;
    chc[c1] = chc[c2] = 1;
  }
  long long int sr = 0;
  long long int sc = 0;
  for (int i = 1; i <= chr.size() - 1; i++) {
    sr += chr[i];
  }
  for (int i = 1; i <= chc.size() - 1; i++) {
    sc += chc[i];
  }
  vector<long long int> fac(max(h, w) + 1, 1);
  for (long long int i = 2; i <= max(h, w); i++) {
    fac[i] = ((i * fac[i - 1]) % mod);
  }
  vector<long long int> mfac(max(h, w) + 1, 1);
  for (long long int i = 0; i <= max(h, w); i++) {
    mfac[i] = modinv(fac[i], mod);
  }
  long long int ans = 0;
  vector<vector<long long int> > dp1(h + 1);
  dp1[0].resize(h + 1);
  dp1[0][0] = 1;
  dp1[1].resize(h + 1);
  dp1[1][0] = 1;
  vector<vector<long long int> > dp2(w + 1);
  dp2[0].resize(w + 1);
  dp2[0][0] = 1;
  dp2[1].resize(w + 1);
  dp2[1][0] = 1;
  for (int i = 2; i <= h; i++) {
    dp1[i].resize(h + 1);
    dp1[i][0] = 1;
    for (int j = 1; 2 * j <= h; j++) {
      if (chr[i] == 1 || chr[i - 1] == 1) {
        dp1[i][j] = dp1[i - 1][j];
      } else {
        dp1[i][j] = ((dp1[i - 1][j] + dp1[i - 2][j - 1]) % mod);
      }
    }
  }
  for (int i = 2; i <= w; i++) {
    dp2[i].resize(w + 1);
    dp2[i][0] = 1;
    for (int j = 1; 2 * j <= w; j++) {
      if (chc[i] == 1 || chc[i - 1] == 1) {
        dp2[i][j] = dp2[i - 1][j];
      } else {
        dp2[i][j] = ((dp2[i - 1][j] + dp2[i - 2][j - 1]) % mod);
      }
    }
  }
  for (long long int numh = 0; 2 * numh <= h; numh++) {
    for (long long int numc = 0; 2 * numc <= w; numc++) {
      if (2 * numh + numc + sr <= h && numh + 2 * numc + sc <= w) {
        long long int q = ((fac[numh] * fac[numc]) % mod);
        q = ((q * ((dp1[h][numh] * dp2[w][numc]) % mod)) % mod);
        q = ((q * ((((fac[h - 2 * numh - sr] * mfac[numc]) % mod) *
                    mfac[h - 2 * numh - numc - sr]) %
                   mod)) %
             mod);
        q = ((q * ((((fac[w - 2 * numc - sc] * mfac[numh]) % mod) *
                    mfac[w - numh - 2 * numc - sc]) %
                   mod)) %
             mod);
        ans = ((ans + q) % mod);
      }
    }
  }
  cout << ans << endl;
}