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;
template <class T>
int chkmax(T &a, T b) {
  if (b > a) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
int chkmin(T &a, T b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
template <class iterator>
void output(iterator begin, iterator end, ostream &out = cerr) {
  while (begin != end) {
    out << (*begin) << " ";
    begin++;
  }
  out << endl;
}
template <class T>
void output(T x, ostream &out = cerr) {
  output(x.begin(), x.end(), out);
}
void fast_io() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
vector<int> get_zero(int *a, int n) {
  int lst = 0;
  vector<int> res;
  for (int i = 0; i <= n; ++i) {
    if (i == n || a[i] == 1) {
      if (lst) {
        res.push_back(lst);
        lst = 0;
      }
    }
    if (i < n && a[i] == 0) {
      lst++;
    }
  }
  return res;
}
const long long MOD = 998244353;
const int mx = 3610;
int H, W, chips, used1[mx], used2[mx];
vector<int> v1, v2;
void read_and_parse() {
  cin >> H >> W >> chips;
  for (int i = 0; i < chips; ++i) {
    int x1, Y1, x2, y2;
    cin >> x1 >> Y1 >> x2 >> y2;
    x1--;
    Y1--;
    x2--;
    y2--;
    used1[x1] = 1;
    used1[x2] = 1;
    used2[Y1] = 1;
    used2[y2] = 1;
  }
  v1 = get_zero(used1, H);
  v2 = get_zero(used2, W);
  sort(v1.begin(), v1.end());
  sort(v2.begin(), v2.end());
}
long long C[mx][mx];
void calc_C() {
  for (int i = 0; i < mx; ++i) {
    for (int j = 0; j < mx; ++j) {
      if (j == 0) {
        C[i][j] = 1;
        continue;
      }
      if (i == 0) {
        C[i][j] = 0;
        continue;
      }
      C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % MOD;
    }
  }
}
long long get_C(int n, int k) {
  if (n < k) {
    return 0;
  }
  return C[n][k];
}
long long dp[mx][mx];
void calc_dp() {
  for (int i = 0; i < mx; ++i) {
    for (int j = 0; j < mx; ++j) {
      if (j == 0) {
        dp[i][j] = 1;
        continue;
      }
      if (i == 0) {
        dp[i][j] = 0;
        continue;
      }
      dp[i][j] = dp[i - 1][j];
      if (i >= 2) {
        dp[i][j] = (dp[i][j] + dp[i - 2][j - 1]) % MOD;
      }
    }
  }
}
vector<long long> get_dp(vector<int> &a, int l, int r, int sum) {
  if (l > r) {
    return {1};
  }
  if (l == r) {
    return vector<long long>(dp[a[l]], dp[a[l]] + a[l] / 2 + 1);
  }
  int lsum = 0;
  for (int i = l; i < r; ++i) {
    lsum += a[i];
    if (2 * lsum >= sum || i == r - 1) {
      vector<long long> res_l = get_dp(a, l, i, lsum);
      vector<long long> res_r = get_dp(a, i + 1, r, sum - lsum);
      vector<long long> res((int)res_l.size() + (int)res_r.size() - 1);
      for (int x = 0; x < res_l.size(); ++x) {
        for (int y = 0; y < res_r.size(); ++y) {
          res[x + y] = (res[x + y] + res_l[x] * res_r[y]) % MOD;
        }
      }
      return res;
    }
  }
  assert(0);
}
long long fact[mx];
signed main() {
  fast_io();
  fact[0] = 1;
  for (int i = 1; i < mx; ++i) {
    fact[i] = (fact[i - 1] * (long long)i) % MOD;
  }
  read_and_parse();
  calc_C();
  calc_dp();
  int n = 0, m = 0;
  for (auto x : v1) {
    n += x;
  }
  for (auto x : v2) {
    m += x;
  }
  vector<long long> dp1 = get_dp(v1, 0, (int)v1.size() - 1, n);
  vector<long long> dp2 = get_dp(v2, 0, (int)v2.size() - 1, m);
  long long ans = 0;
  for (int k1 = 0; k1 < dp1.size(); ++k1) {
    for (int k2 = 0; k2 < dp2.size(); ++k2) {
      long long cnt1 = (dp1[k1] * get_C(n - 2 * k1, k2)) % MOD;
      long long cnt2 = (dp2[k2] * get_C(m - 2 * k2, k1)) % MOD;
      long long F = (fact[k1] * fact[k2]) % MOD;
      ans = (ans + cnt1 * cnt2 % MOD * F % MOD) % MOD;
    }
  }
  cout << ans << endl;
}