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;
using ll = long long;
const ll MOD = 998244353;
ll modInv(ll x, ll b = MOD - 2) {
  if (b & 1) return x * modInv(x, b - 1) % MOD;
  if (b == 0) return 1;
  return modInv(x * x % MOD, b / 2);
}
const int N = 5000;
const int M = 1e6;
bool vb[N];
bool hb[N];
ll fact[M];
ll inv_fact[M];
ll choose(ll a, ll b) {
  ll dv = inv_fact[b] * inv_fact[a - b] % MOD;
  return fact[a] * dv % MOD;
}
vector<ll> calc(const vector<int>& vals) {
  int n = vals.size();
  vector<ll> dp(N, 0);
  dp[0] = 1;
  int cur = 0;
  for (int i = 1; i <= n; ++i) {
    int v = vals[i - 1];
    vector<ll> nxt(N, 0);
    for (int x = 0; 2 * x <= v; ++x) {
      ll mult = choose(v - x, x);
      for (int y = 0; y <= cur; ++y) {
        nxt[y + x] = (nxt[y + x] + dp[y] * mult) % MOD;
      }
    }
    cur += v / 2;
    dp = nxt;
  }
  return dp;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  fact[0] = 1;
  for (int i = 1; i < M; ++i) fact[i] = (fact[i - 1] * i) % MOD;
  for (int i = 0; i < M; ++i) inv_fact[i] = modInv(fact[i]);
  int h, w, n;
  cin >> h >> w >> n;
  for (int i = 0; i < n; ++i) {
    int y1, x1, y2, x2;
    cin >> y1 >> x1 >> y2 >> x2;
    vb[x1 - 1] = true;
    vb[x2 - 1] = true;
    hb[y1 - 1] = true;
    hb[y2 - 1] = true;
  }
  ll tot1 = 0;
  vector<int> cols = {0};
  for (int x = 0; x < w; ++x) {
    if (vb[x]) {
      if (cols.back() != 0) cols.push_back(0);
    } else {
      ++tot1;
      ++cols.back();
    }
  }
  if (cols.back() == 0) cols.pop_back();
  ll tot2 = 0;
  vector<int> rows = {0};
  for (int y = 0; y < h; ++y) {
    if (hb[y]) {
      if (rows.back() != 0) rows.push_back(0);
    } else {
      ++tot2;
      ++rows.back();
    }
  }
  if (rows.back() == 0) rows.pop_back();
  auto dp1 = calc(cols);
  auto dp2 = calc(rows);
  ll ans = 0;
  for (int x = 0; x <= tot1 / 2; ++x) {
    for (int y = 0; y <= tot2 / 2; ++y) {
      if (tot1 < 2 * x + y || tot2 < x + 2 * y) continue;
      if (x >= dp1.size() || y > dp2.size()) continue;
      ll v1 = dp1[x] * choose(tot1 - 2 * x, y) % MOD;
      ll v2 = dp2[y] * choose(tot2 - 2 * y, x) % MOD;
      v1 = (v1 * fact[x]) % MOD;
      v2 = (v2 * fact[y]) % MOD;
      ans = (ans + v1 * v2) % MOD;
    }
  }
  ans %= MOD;
  if (ans < 0) ans += MOD;
  cout << ans << '\n';
}