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 p = 998244353;
const int N = 4e3 + 50;
int n, m, k;
long long dpx[3][N], dpy[3][N], cntx, cnty, ans, fac[N], fx[N], fy[N], dbx, dby,
    ifac[N];
bool usedx[N], usedy[N];
inline long long read() {
  char c;
  bool bo;
  long long res;
  while (((c = getchar()) < 48 || c > 57) && c != 45)
    ;
  if (c == 45)
    bo = 1, res = 0;
  else
    bo = 0, res = c - 48;
  while ((c = getchar()) >= 48 && c <= 57)
    res = (res << 3) + (res << 1) + c - 48;
  return bo ? ~res + 1 : res;
}
inline long long fpow(long long x, long long y) {
  long long res = 1;
  while (y) {
    if (y & 1) (res *= x) %= p;
    (x *= x) %= p;
    y >>= 1;
  }
  return res;
}
inline void seive() {
  fac[0] = 1;
  ifac[0] = 1;
  for (int i = 1; i <= max(n, m); i++) fac[i] = fac[i - 1] * i % p;
  for (int i = 1; i <= max(n, m); i++) ifac[i] = fpow(fac[i], p - 2);
}
inline long long C(long long x, long long y) {
  return fac[x] * ifac[y] % p * ifac[x - y] % p;
}
int main() {
  n = read();
  m = read();
  k = read();
  seive();
  for (int i = 1; i <= k; i++)
    usedx[read()] = 1, usedy[read()] = 1, usedx[read()] = 1, usedy[read()] = 1;
  cntx = n, cnty = m;
  for (int i = 1; i <= n; i++) cntx -= usedx[i];
  for (int i = 1; i <= m; i++) cnty -= usedy[i];
  dpx[0][0] = dpy[0][0] = 1;
  usedx[0] = usedy[0] = 1;
  for (int i = 1; i <= n; i++)
    if (usedx[i] || usedx[i - 1])
      fx[i] = fx[i - 1];
    else
      fx[i] = max(fx[i - 1], fx[i - 2] + 1);
  dbx = fx[n];
  for (int i = 1; i <= m; i++)
    if (usedy[i] || usedy[i - 1])
      fy[i] = fy[i - 1];
    else
      fy[i] = max(fy[i - 1], fy[i - 2] + 1);
  dby = fy[m];
  for (int i = 1; i <= n; i++) {
    int tmp = i % 3, lst = (i - 1) % 3, nxt = (i + 1) % 3;
    memset(dpx[i % 3], 0, sizeof(dpx[i % 3]));
    dpx[tmp][0] = dpx[lst][0];
    if (usedx[i] || usedx[i - 1])
      for (int j = fx[i]; j >= 1; j--) dpx[tmp][j] = dpx[lst][j];
    else
      for (int j = fx[i]; j >= 1; j--)
        dpx[tmp][j] = (dpx[lst][j] + dpx[nxt][j - 1]) % p;
  }
  for (int i = 1; i <= m; i++) {
    int tmp = i % 3, lst = (i - 1) % 3, nxt = (i + 1) % 3;
    memset(dpy[i % 3], 0, sizeof(dpy[i % 3]));
    dpy[tmp][0] = dpy[lst][0];
    if (usedy[i] || usedy[i - 1])
      for (int j = fy[i]; j >= 1; j--) dpy[tmp][j] = dpy[lst][j];
    else
      for (int j = fy[i]; j >= 1; j--)
        dpy[tmp][j] = (dpy[lst][j] + dpy[nxt][j - 1]) % p;
  }
  for (int x = 0; x <= dbx; x++)
    for (int y = 0; y <= dby; y++)
      if (2 * x + y <= cntx && 2 * y + x <= cnty)
        (ans += fac[x] * fac[y] % p * C(cnty - 2 * y, x) % p *
                C(cntx - 2 * x, y) % p * dpx[n % 3][x] % p * dpy[m % 3][y] %
                p) %= p;
  printf("%lld", ans);
  return 0;
}