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 int MOD = 998244353;
const int kMaxVal = 3600;
int main() {
  int h, w, n;
  cin >> h >> w >> n;
  vector<int> fact(kMaxVal + 1, 1);
  vector<int> inv(kMaxVal + 1, 1);
  vector<int> inv_fact(kMaxVal + 1, 1);
  for (int i = 2; i <= kMaxVal; i += 1) {
    fact[i] = 1LL * fact[i - 1] * i % MOD;
    inv[i] = (MOD - 1LL * inv[MOD % i] * (MOD / i) % MOD);
    inv_fact[i] = 1LL * inv_fact[i - 1] * inv[i] % MOD;
  }
  auto comb = [&](int a, int b) {
    if (a < b) return 0;
    int ans = 1LL * fact[a] * inv_fact[b] % MOD;
    ans = 1LL * ans * inv_fact[a - b] % MOD;
    return ans;
  };
  auto add = [](int &a, int b) {
    a += b;
    while (a >= MOD) a -= MOD;
    while (a < 0) a += MOD;
  };
  vector<int> used_row(h, 0);
  vector<int> used_column(w, 0);
  for (int i = 0; i < n; i += 1) {
    int r1, r2, c1, c2;
    cin >> r1 >> c1 >> r2 >> c2;
    r1 -= 1, c1 -= 1, r2 -= 1, c2 -= 1;
    used_row[r1] = used_row[r2] = 1;
    used_column[c1] = used_column[c2] = 1;
  }
  auto getWays = [&](vector<int> used) -> vector<int> {
    int k = used.size();
    vector<vector<int>> dp(k + 1, vector<int>(k + 1, 0));
    dp[0][0] = 1;
    for (int i = 1; i <= k; i += 1) {
      for (int j = 0; j <= i; j += 1) {
        dp[i][j] = dp[i - 1][j];
        if (i - 2 >= 0 and j - 1 >= 0 and (used[i - 1] + used[i - 2] == 0))
          add(dp[i][j], dp[i - 2][j - 1]);
      }
    }
    return dp[k];
  };
  auto row_ways = getWays(used_row);
  auto column_ways = getWays(used_column);
  int space_row = h - accumulate(used_row.begin(), used_row.end(), 0);
  int space_column = w - accumulate(used_column.begin(), used_column.end(), 0);
  int ans = 0;
  for (int extra_row = 0; extra_row < w; extra_row += 1)
    for (int extra_column = 0; extra_column < h; extra_column += 1) {
      assert(extra_column < int(row_ways.size()) and
             extra_row < int(column_ways.size()));
      int coef = 1LL * row_ways[extra_column] * column_ways[extra_row] % MOD;
      int rem_row = space_row - 2 * extra_column;
      int rem_column = space_column - 2 * extra_row;
      coef = 1LL * coef * comb(rem_row, extra_row) % MOD;
      coef = 1LL * coef * comb(rem_column, extra_column) % MOD;
      coef = 1LL * coef * fact[extra_row] % MOD;
      coef = 1LL * coef * fact[extra_column] % MOD;
      add(ans, coef);
    }
  cout << ans << "\n";
}