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>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("unroll-loops")
using namespace std;
template <typename T, typename U>
inline ostream &operator<<(ostream &_out, const pair<T, U> &_p) {
  _out << _p.first << ' ' << _p.second;
  return _out;
}
template <typename T, typename U>
inline istream &operator>>(istream &_in, pair<T, U> &_p) {
  _in >> _p.first >> _p.second;
  return _in;
}
template <typename T>
inline ostream &operator<<(ostream &_out, const vector<T> &_v) {
  if (_v.empty()) {
    return _out;
  }
  _out << _v.front();
  for (auto _it = ++_v.begin(); _it != _v.end(); ++_it) {
    _out << ' ' << *_it;
  }
  return _out;
}
template <typename T>
inline istream &operator>>(istream &_in, vector<T> &_v) {
  for (auto &_i : _v) {
    _in >> _i;
  }
  return _in;
}
const long long MAXN = 3604;
const long long MAXM = MAXN / 2;
const long long INF = 1e9;
const long long MOD = 998244353;
long long sum(long long a, long long b) {
  if (a + b >= MOD) {
    return a + b - MOD;
  }
  return a + b;
}
long long mul(long long a, long long b) {
  if (a * b >= MOD) {
    return (a * b) % MOD;
  }
  return a * b;
}
long long sqr(long long a) { return (a * a) % MOD; }
long long bin_pow(long long a, long long b) {
  if (b == 0) {
    return 1;
  }
  if (b % 2) {
    return mul(a, bin_pow(a, b - 1));
  }
  return sqr(bin_pow(a, b / 2));
}
long long fact[MAXN];
long long rfact[MAXN];
long long dp[2][MAXM][MAXN];
bool connected[MAXN];
long long dp1[MAXM];
long long dp2[MAXN][MAXM];
inline long long c(long long n, long long k) {
  return mul(fact[n], mul(rfact[k], rfact[n - k]));
}
class FSbalansirovannieRaspolozheniyaDomino {
 public:
  void solve(std::istream &in, std::ostream &out) {
    fact[0] = 1;
    for (long long i = 1; i < MAXN; i++) {
      fact[i] = mul(i, fact[i - 1]);
    }
    rfact[MAXN - 1] = bin_pow(fact[MAXN - 1], MOD - 2);
    for (long long j = MAXN - 1; j >= 1; j--) {
      rfact[j - 1] = mul(rfact[j], j);
    }
    long long h, w;
    in >> h >> w;
    long long n;
    in >> n;
    vector<pair<pair<long long, long long>, pair<long long, long long>>> a(n);
    in >> a;
    {
      for (long long i = 0; i <= h; i++) {
        for (long long j = 0; j < MAXM; j++) {
          dp2[i][j] = 0;
          dp[0][j][i] = 0;
        }
        connected[i] = 0;
      }
      for (long long j = 0; j < MAXM; j++) {
        dp1[j] = 0;
      }
      for (auto v : a) {
        connected[v.first.first - 1] = 1;
        connected[v.second.first - 1] = 1;
      }
      long long counts = 0;
      for (long long j = 0; j < h; j++) {
        counts += !connected[j];
      }
      dp1[0] = 1;
      for (long long i = 0; i <= h; i++) {
        for (long long j = 0; j < MAXM; j++) {
          dp1[j] = sum(dp1[j], dp2[i][j]);
        }
        if (i + 1 < h && connected[i] == 0 && connected[i + 1] == 0) {
          for (long long j = 0; j + 1 < MAXM; j++) {
            dp2[i + 2][j + 1] = dp1[j];
          }
        }
      }
      for (long long i = 0; i < MAXM; i++) {
        for (long long j = 0; j <= counts - 2 * i; j++) {
          dp[0][i][j] =
              mul(dp1[i], mul(fact[counts - 2 * i],
                              mul(fact[i], rfact[counts - 2 * i - j])));
        }
      }
    }
    {
      for (long long i = 0; i <= w; i++) {
        for (long long j = 0; j < MAXM; j++) {
          dp2[i][j] = 0;
          dp[1][j][i] = 0;
        }
        connected[i] = 0;
      }
      for (long long j = 0; j < MAXM; j++) {
        dp1[j] = 0;
      }
      for (auto v : a) {
        connected[v.first.second - 1] = 1;
        connected[v.second.second - 1] = 1;
      }
      long long counts = 0;
      for (long long j = 0; j < w; j++) {
        counts += !connected[j];
      }
      dp1[0] = 1;
      for (long long i = 0; i <= w; i++) {
        for (long long j = 0; j < MAXM; j++) {
          dp1[j] = sum(dp1[j], dp2[i][j]);
        }
        if (i + 1 < w && connected[i] == 0 && connected[i + 1] == 0) {
          for (long long j = 0; j + 1 < MAXM; j++) {
            dp2[i + 2][j + 1] = dp1[j];
          }
        }
      }
      for (long long i = 0; i < MAXM; i++) {
        for (long long j = 0; j <= counts - 2 * i; j++) {
          dp[1][i][j] = mul(dp1[i], c(counts - 2 * i, j));
        }
      }
    }
    long long ans = 0;
    for (long long i = 0; 2 * i <= h; i++) {
      for (long long j = 0; 2 * j <= w; j++) {
        ans += dp[0][i][j] * dp[1][j][i];
        if (ans >= MOD * MOD) {
          ans -= MOD * MOD;
        }
      }
    }
    ans %= MOD;
    out << ans;
  }
};
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  FSbalansirovannieRaspolozheniyaDomino solver;
  std::istream &in(std::cin);
  std::ostream &out(std::cout);
  solver.solve(in, out);
  return 0;
}