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;
long long gcd(long long x, long long y) { return (!y ? x : gcd(y, x % y)); }
const long long maxn = 4000 + 10;
const long long mod = 998244353;
inline long long ad(long long x, long long y) { return (x + y) % mod; }
inline long long mu(long long x, long long y) { return 1LL * x * y % mod; }
long long a[maxn], b[maxn];
long long dp[maxn], odp[maxn], dp1[maxn];
const long long M = 1e5 + 10;
long long fact[M], inv[M];
inline long long C(long long r, long long n) {
  if (r < 0 || r > n || n < 0) return 0;
  return mu(fact[n], mu(inv[r], inv[n - r]));
}
inline long long gg(long long n, long long ted) {
  if (ted * 2 > n) return 0;
  if (ted == 0) return 1;
  n -= ted * 2;
  return C(n, n + ted);
}
inline long long bpow(long long x, long long y) {
  long long res = 1;
  while (y) {
    if (y & 1) res = mu(res, x);
    x = mu(x, x);
    y >>= 1;
  }
  return res;
}
void prep() {
  for (long long i = 0; i < M; i++) fact[i] = (!i ? 1 : mu(i, fact[i - 1]));
  for (long long i = 0; i < M; i++) inv[i] = bpow(fact[i], mod - 2);
}
int32_t main() {
  prep();
  ios::sync_with_stdio(0), cin.tie(0);
  long long n, m, q;
  cin >> n >> m >> q;
  for (long long i = 0; i < q; i++) {
    long long r, c;
    cin >> r >> c;
    r--, c--;
    a[r] = 1, b[c] = 1;
    cin >> r >> c;
    r--, c--;
    a[r] = 1, b[c] = 1;
  }
  vector<long long> row, col;
  for (long long i = 0; i < n; i++) {
    if (!a[i] && (!i || a[i - 1])) {
      long long cnt = 0;
      for (long long j = i; j < n && a[j] == 0; j++) cnt++;
      row.push_back(cnt);
    }
  }
  for (long long i = 0; i < m; i++) {
    if (!b[i] && (!i || b[i - 1])) {
      long long cnt = 0;
      for (long long j = i; j < m && b[j] == 0; j++) cnt++;
      col.push_back(cnt);
    }
  }
  dp[0] = 1;
  long long sm = 0;
  for (long long x : row) {
    memset(odp, 0, sizeof odp);
    for (long long i = 0; i <= sm / 2; i++) {
      for (long long j = 0; j * 2 <= x; j++) {
        odp[i + j] = ad(odp[i + j], mu(dp[i], gg(x, j)));
      }
    }
    sm += x;
    for (long long i = 0; i <= sm / 2; i++) dp[i] = odp[i];
  }
  for (long long i = 0; i < n; i++) dp1[i] = dp[i];
  memset(dp, 0, sizeof dp);
  dp[0] = 1;
  long long sm1 = sm;
  sm = 0;
  for (long long x : col) {
    memset(odp, 0, sizeof odp);
    for (long long i = 0; i <= sm / 2; i++) {
      for (long long j = 0; j * 2 <= x; j++) {
        odp[i + j] = ad(odp[i + j], mu(dp[i], gg(x, j)));
      }
    }
    sm += x;
    for (long long i = 0; i <= sm / 2; i++) dp[i] = odp[i];
  }
  long long ans = 0;
  long long T = max(n, m);
  for (long long i = 0; i <= T; i++) {
    for (long long j = 0; j <= T; j++) {
      if (i * 2 + j > sm1 || j * 2 + i > sm) continue;
      long long t1 = mu(dp1[i], dp[j]);
      long long t2 = mu(C(j, sm1 - i * 2), C(i, sm - j * 2));
      long long t3 = mu(fact[i], fact[j]);
      ans = ad(ans, mu(mu(t1, t2), t3));
    }
  }
  cout << ans << '\n';
}