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>
const int md = 998244353;
const long long inf = 4e18;
const int OO = 0;
const int OOO = 1;
using namespace std;
const int mxn = 4000;
long long pw(long long b, long long e) {
  long long rtn = 1;
  while (e) {
    if (e & 1) rtn = (rtn * b) % md;
    e /= 2, b = b * b % md;
  }
  return rtn;
}
long long inv(long long x) { return pw(x, md - 2); }
long long F[mxn], FI[mxn];
long long choose(long long n, long long k) {
  if (n < k) return 0;
  return F[n] * FI[k] % md * FI[n - k] % md;
}
int tmp[mxn][mxn];
void work(const vector<int> &A, int D[mxn][mxn]) {
  int i1 = 0, i2 = 1;
  int sum = 0;
  for (int j = 0; j < mxn; j++) tmp[0][j] = 0;
  tmp[0][0] = 1;
  if (i2 == A[i1]) {
    i1++;
    i2 = 1;
  } else
    i2++;
  sum++;
  while (i1 < A.size()) {
    tmp[sum][0] = 1;
    for (int j = 1; j < mxn; j++) {
      tmp[sum][j] = 0;
      if (i2 >= 2) {
        if (sum == 1) {
          if (j == 1)
            tmp[1][j] = 1;
          else
            tmp[1][j] = 0;
        } else {
          tmp[sum][j] = (tmp[sum - 1][j] + tmp[sum - 2][j - 1]) % md;
        }
      } else {
        tmp[sum][j] = tmp[sum - 1][j];
      }
    }
    if (i2 == A[i1]) {
      i1++;
      i2 = 1;
    } else
      i2++;
    sum++;
  }
  for (int x = 0; x < mxn; x++)
    for (int y = 0; y < mxn; y++)
      D[x][y] = (long long)tmp[sum - 1][y] * choose(sum - 2 * y, x) % md;
}
int h, w, n;
int fr[mxn], fc[mxn];
vector<int> A, B;
int D[mxn][mxn], E[mxn][mxn];
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  cin >> h >> w >> n;
  for (int i = 0; i < h; i++) fr[i] = 1;
  for (int i = 0; i < w; i++) fc[i] = 1;
  for (int i = 0, p[4]; i < n; i++) {
    cin >> p[0] >> p[1] >> p[2] >> p[3];
    fr[p[0] - 1] = fr[p[2] - 1] = 0;
    fc[p[1] - 1] = fc[p[3] - 1] = 0;
  }
  int cnt = 0;
  for (int i = 0; i < h; i++) {
    if (fr[i])
      cnt++;
    else {
      if (cnt) A.push_back(cnt);
      cnt = 0;
    }
  }
  if (cnt) A.push_back(cnt);
  cnt = 0;
  for (int j = 0; j < w; j++) {
    if (fc[j])
      cnt++;
    else {
      if (cnt) B.push_back(cnt);
      cnt = 0;
    }
  }
  if (cnt) B.push_back(cnt);
  if (A.size() == 0 || B.size() == 0) return cout << 1 << endl, 0;
  F[0] = FI[0] = 1;
  for (int i = 1; i < mxn; i++) {
    F[i] = i;
    FI[i] = inv(i);
    F[i] = (F[i] * F[i - 1]) % md;
    FI[i] = (FI[i] * FI[i - 1]) % md;
  }
  if (OO) {
    for (const auto &i : A) cout << i << " ";
    cout << '\n';
  }
  work(A, D);
  work(B, E);
  if (OO) {
    for (int i = 0; i < 2; i++)
      for (int j = 0; j < 2; j++)
        cout << i << " " << j << " " << D[i][j] << '\n';
  }
  long long ans = 0;
  for (int x = 0; x < mxn; x++)
    for (int y = 0; y < mxn; y++) {
      long long add = F[x] * F[y] % md;
      add = add * (long long)D[x][y] % md;
      add = add * (long long)E[y][x] % md;
      ans = (ans + add) % md;
    }
  cout << ans << '\n';
}