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;
struct mod_int {
  int val;
  mod_int(long long v = 0) {
    if (v < 0) v = v % MOD + MOD;
    if (v >= MOD) v %= MOD;
    val = v;
  }
  static int mod_inv(int a, int m = MOD) {
    int g = m, r = a, x = 0, y = 1;
    while (r != 0) {
      int q = g / r;
      g %= r;
      swap(g, r);
      x -= q * y;
      swap(x, y);
    }
    return x < 0 ? x + m : x;
  }
  explicit operator int() const { return val; }
  mod_int &operator+=(const mod_int &other) {
    val += other.val;
    if (val >= MOD) val -= MOD;
    return *this;
  }
  mod_int &operator-=(const mod_int &other) {
    val -= other.val;
    if (val < 0) val += MOD;
    return *this;
  }
  static unsigned fast_mod(uint64_t x, unsigned m = MOD) {
    return x % m;
    unsigned x_high = x >> 32, x_low = (unsigned)x;
    unsigned quot, rem;
    asm("divl %4\n" : "=a"(quot), "=d"(rem) : "d"(x_high), "a"(x_low), "r"(m));
    return rem;
  }
  mod_int &operator*=(const mod_int &other) {
    val = fast_mod((uint64_t)val * other.val);
    return *this;
  }
  mod_int &operator/=(const mod_int &other) { return *this *= other.inv(); }
  friend mod_int operator+(const mod_int &a, const mod_int &b) {
    return mod_int(a) += b;
  }
  friend mod_int operator-(const mod_int &a, const mod_int &b) {
    return mod_int(a) -= b;
  }
  friend mod_int operator*(const mod_int &a, const mod_int &b) {
    return mod_int(a) *= b;
  }
  friend mod_int operator/(const mod_int &a, const mod_int &b) {
    return mod_int(a) /= b;
  }
  mod_int &operator++() {
    val = val == MOD - 1 ? 0 : val + 1;
    return *this;
  }
  mod_int &operator--() {
    val = val == 0 ? MOD - 1 : val - 1;
    return *this;
  }
  mod_int operator++(int) {
    mod_int before = *this;
    ++*this;
    return before;
  }
  mod_int operator--(int) {
    mod_int before = *this;
    --*this;
    return before;
  }
  mod_int operator-() const { return val == 0 ? 0 : MOD - val; }
  bool operator==(const mod_int &other) const { return val == other.val; }
  bool operator!=(const mod_int &other) const { return val != other.val; }
  mod_int inv() const { return mod_inv(val); }
  mod_int pow(long long p) const {
    assert(p >= 0);
    mod_int a = *this, result = 1;
    while (p > 0) {
      if (p & 1) result *= a;
      a *= a;
      p >>= 1;
    }
    return result;
  }
};
vector<mod_int> inv, factorial, inv_factorial;
void prepare_factorials(int maximum) {
  inv.assign(maximum + 1, 1);
  for (int p = 2; p * p <= MOD; p++) assert(MOD % p != 0);
  for (int i = 2; i <= maximum; i++) inv[i] = inv[MOD % i] * (MOD - MOD / i);
  factorial.resize(maximum + 1);
  inv_factorial.resize(maximum + 1);
  factorial[0] = inv_factorial[0] = 1;
  for (int i = 1; i <= maximum; i++) {
    factorial[i] = i * factorial[i - 1];
    inv_factorial[i] = inv[i] * inv_factorial[i - 1];
  }
}
mod_int choose(long long n, long long r) {
  if (r < 0 || r > n) return 0;
  return factorial[n] * inv_factorial[r] * inv_factorial[n - r];
}
mod_int inv_choose(long long n, long long r) {
  assert(0 <= r && r <= n);
  return inv_factorial[n] * factorial[r] * factorial[n - r];
}
mod_int permute(long long n, long long k) {
  if (k < 0 || k > n) return 0;
  return factorial[n] * inv_factorial[n - k];
}
mod_int inv_permute(long long n, long long k) {
  assert(0 <= k && k <= n);
  return inv_factorial[n] * factorial[n - k];
}
int main() {
  int H, W, N;
  cin >> H >> W >> N;
  prepare_factorials(max(H, W));
  vector<bool> row_bad(H, false);
  vector<bool> col_bad(W, false);
  for (int i = 0; i < N; i++) {
    int r1, c1, r2, c2;
    cin >> r1 >> c1 >> r2 >> c2;
    r1--;
    c1--;
    r2--;
    c2--;
    row_bad[r1] = row_bad[r2] = true;
    col_bad[c1] = col_bad[c2] = true;
  }
  int GR = 0, GC = 0;
  for (int row = 0; row < H; row++) GR += !row_bad[row];
  for (int col = 0; col < W; col++) GC += !col_bad[col];
  vector<vector<mod_int>> row_dp(H + 1);
  row_dp[0] = row_dp[1] = {1};
  for (int row = 2; row <= H; row++) {
    row_dp[row] = row_dp[row - 1];
    if (row % 2 == 0) row_dp[row].push_back(0);
    if (!row_bad[row - 2] && !row_bad[row - 1])
      for (int blocks = 1; 2 * blocks <= row; blocks++)
        row_dp[row][blocks] += row_dp[row - 2][blocks - 1];
  }
  vector<vector<mod_int>> col_dp(W + 1);
  col_dp[0] = col_dp[1] = {1};
  for (int col = 2; col <= W; col++) {
    col_dp[col] = col_dp[col - 1];
    if (col % 2 == 0) col_dp[col].push_back(0);
    if (!col_bad[col - 2] && !col_bad[col - 1])
      for (int blocks = 1; 2 * blocks <= col; blocks++)
        col_dp[col][blocks] += col_dp[col - 2][blocks - 1];
  }
  mod_int total = 0;
  for (int vert = 0; 2 * vert <= GR && vert <= GC; vert++)
    for (int horiz = 0; 2 * vert + horiz <= GR && vert + 2 * horiz <= GC;
         horiz++)
      total += row_dp[H][vert] * col_dp[W][horiz] *
               permute(GR - 2 * vert, horiz) * permute(GC - 2 * horiz, vert);
  cout << (int)total << '\n';
}