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 mod = 998244353;
const long long INF = mod * mod;
const long double eps = 1e-8;
const long double pi = acos(-1.0);
long long mod_pow(long long x, long long n) {
  long long ret = 1;
  while (n > 0) {
    if (n % 2) ret = ret * x % mod;
    x = x * x % mod;
    n >>= 1;
  }
  return ret;
}
struct perm {
 private:
  int sz;
  vector<long long> p, invp;

 public:
  perm(int n) {
    sz = n + 1;
    p.resize(sz), invp.resize(sz);
    p[0] = 1;
    for (int i = 1; i <= sz - 1; i++) {
      p[i] = p[i - 1] * i % mod;
    }
    invp[sz - 1] = 1;
    long long cop = mod - 2, x = p[sz - 1];
    while (cop) {
      if (cop % 2) invp[sz - 1] = invp[sz - 1] * x % mod;
      cop >>= 1;
      x = x * x % mod;
    }
    for (int i = sz - 1 - 1; i >= 0; i--) {
      invp[i] = invp[i + 1] * (i + 1) % mod;
    }
  }
  long long comb(long long x, long long y) {
    if (x < y || y < 0) return 0;
    long long ret = p[x];
    (ret *= invp[y]) %= mod;
    (ret *= invp[x - y]) %= mod;
    return ret;
  }
  long long combP(long long x, long long y) {
    if (x < y || y < 0) return 0;
    return p[x] * invp[x - y] % mod;
  }
};
perm p(1 << 17);
long long hdp[3601][1803];
long long wdp[3601][1803];
void solve() {
  int h, w, n;
  cin >> h >> w >> n;
  vector<bool> bh(h, true), bw(w, true);
  for (int i = 0; i < n; i++) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    x1--;
    y1--;
    x2--;
    y2--;
    bh[x1] = bh[x2] = false;
    bw[y1] = bw[y2] = false;
  }
  vector<int> vh, vw;
  for (int i = 0; i < h; i++) {
    if (bh[i]) vh.push_back(i);
  }
  for (int i = 0; i < w; i++) {
    if (bw[i]) vw.push_back(i);
  }
  hdp[0][0] = 1;
  for (int i = 0; i < vh.size(); i++) {
    for (int j = 0; j < 1801; j++) {
      (hdp[i + 1][j] += hdp[i][j]) %= mod;
      if (i + 1 < vh.size() && vh[i + 1] == vh[i] + 1) {
        (hdp[i + 2][j + 1] += hdp[i][j]) %= mod;
      }
    }
  }
  wdp[0][0] = 1;
  for (int i = 0; i < vw.size(); i++) {
    for (int j = 0; j < 1801; j++) {
      (wdp[i + 1][j] += wdp[i][j]) %= mod;
      if (i + 1 < vw.size() && vw[i + 1] == vw[i] + 1) {
        (wdp[i + 2][j + 1] += wdp[i][j]) %= mod;
      }
    }
  }
  long long ans = 0;
  for (int i = 0; i < 1801; i++) {
    int hrest = (int)vh.size() - 2 * i;
    if (hrest < 0) continue;
    for (int j = 0; j < 1801; j++) {
      int wrest = (int)vw.size() - 2 * j;
      if (wrest < 0) continue;
      long long hnum = hdp[vh.size()][i] * p.combP(hrest, j) % mod;
      long long wnum = wdp[vw.size()][j] * p.combP(wrest, i) % mod;
      (ans += (hnum * wnum)) %= mod;
    }
  }
  cout << ans << endl;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  solve();
  return 0;
}