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 maxn = 3605;
const long long dd = 998244353;
long long n, m, t;
long long dp[maxn][maxn], sum[maxn], isum[maxn], g[maxn], d[maxn];
bool row[maxn], col[maxn];
inline long long read() {
  long long ret = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -f;
    ch = getchar();
  }
  while (isdigit(ch)) {
    ret = ret * 10 + ch - '0';
    ch = getchar();
  }
  return ret * f;
}
inline long long qpow(long long x, long long p) {
  long long ans = 1;
  if (x == 0) return 0;
  while (p) {
    if (p & 1) ans = ans * x % dd;
    x = x * x % dd;
    p >>= 1;
  }
  return ans % dd;
}
inline long long inv(long long x) { return qpow(x, dd - 2) % dd; }
inline long long C(long long x, long long y) {
  return x >= y ? sum[x] * (isum[y] * isum[x - y] % dd) % dd : 0;
}
inline long long squ(long long x) { return x * x % dd; }
inline long long mod(long long x) { return x >= dd ? x - dd : x; }
void scan() {
  n = read();
  m = read();
  t = read();
  for (long long k = 1; k <= (t << 1); k++) {
    row[read()] = 1;
    col[read()] = 1;
  }
}
void prework() {
  isum[0] = sum[0] = 1;
  for (long long k = 1; k <= max(n, m); k++) sum[k] = sum[k - 1] * k % dd;
  isum[max(n, m)] = inv(sum[max(n, m)]);
  for (long long k = max(n, m) - 1; k; k--)
    isum[k] = isum[k + 1] * (k + 1) % dd;
  dp[0][0] = dp[1][0] = 1;
  for (long long k = 2; k <= max(n, m); k++) {
    dp[k][0] = 1;
    for (long long j = 1; (j << 1) <= k; j++)
      dp[k][j] = mod(dp[k - 1][j] + dp[k - 2][j - 1]);
  }
}
void solve() {
  row[0] = row[n + 1] = col[0] = col[m + 1] = 1;
  long long nowl = 0, nowr = 0, ans = 0, nowx = 0, nowy = 0, lenx = 0, leny = 0;
  g[0] = d[0] = 1;
  while (nowl <= n) {
    long long sum1 = 0;
    while (row[nowl]) nowl++;
    if (nowl > n) break;
    while (!row[nowl]) nowl++, sum1++;
    for (long long k = nowx; k >= 0; k--) {
      for (long long j = 1; j <= (sum1 >> 1); j++)
        g[k + j] = mod(g[k + j] + g[k] * dp[sum1][j] % dd);
    }
    lenx += sum1;
    nowx += (sum1 >> 1);
  }
  while (nowr <= m) {
    long long sum2 = 0;
    while (col[nowr]) nowr++;
    if (nowr > m) break;
    while (!col[nowr]) nowr++, sum2++;
    for (long long k = nowy; k >= 0; k--) {
      for (long long j = 1; j <= (sum2 >> 1); j++)
        d[k + j] = mod(d[k + j] + d[k] * dp[sum2][j] % dd);
    }
    leny += sum2;
    nowy += (sum2 >> 1);
  }
  for (long long k = 0; k <= nowx; k++)
    for (long long j = 0; j <= nowy; j++) {
      long long l1 = lenx - (k << 1), l2 = leny - (j << 1);
      ans = mod(ans +
                (g[k] * d[j] % dd) *
                    ((C(l1, j) * C(l2, k) % dd) * (sum[k] * sum[j] % dd) % dd) %
                    dd);
    }
  printf("%lld\n", ans);
}
signed main() {
  scan();
  prework();
  solve();
  return 0;
}