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;
long long read() {
  long long x = 0, f = 0;
  char ch = getchar();
  while (!isdigit(ch)) f = ch == '-', ch = getchar();
  while (isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
  return f ? -x : x;
}
template <class T>
void ckmax(T &x, const T &y) {
  if (x < y) x = y;
}
template <class T>
void ckmin(T &x, const T &y) {
  if (x > y) x = y;
}
long long absl(long long x) { return x < 0 ? -x : x; }
const int mod = 998244353;
int Pow(int x, int y) {
  int ans = 1;
  for (; y; y >>= 1, x = (long long)x * x % mod)
    if (y & 1) ans = (long long)ans * x % mod;
  return ans;
}
void Add(int &x, int y) {
  if ((x += y) >= mod) x -= mod;
}
void Del(int &x, int y) {
  if ((x -= y) < 0) x += mod;
}
int Add(int x) { return x >= mod ? x - mod : x; }
int Del(int x) { return x < 0 ? x + mod : x; }
const int N = 3605;
int Fac[N], Inv[N];
void prework(int n) {
  Fac[0] = 1;
  for (int i = (1); i <= (n); i++) Fac[i] = (long long)Fac[i - 1] * i % mod;
  Inv[n] = Pow(Fac[n], mod - 2);
  for (int i = (n); i >= (1); i--) Inv[i - 1] = (long long)Inv[i] * i % mod;
}
int C(int n, int m) {
  if (m > n || m < 0) return 0;
  return (long long)Fac[n] * Inv[m] % mod * Inv[n - m] % mod;
}
int A(int n, int m) {
  if (m > n || m < 0) return 0;
  return (long long)Fac[n] * Inv[n - m] % mod;
}
int n, m, q;
int dp[N][N];
int vr[N], vc[N];
vector<int> solve(int *a, int n) {
  vector<int> now(1, 0);
  for (int i = (1); i <= (n); i++)
    if (a[i] == 0)
      now.back()++;
    else
      now.push_back(0);
  sort(now.begin(), now.end());
  reverse(now.begin(), now.end());
  while (!now.empty() && now.back() == 0) now.pop_back();
  dp[0][0] = dp[1][0] = 1;
  for (int i = (2); i <= (n); i++) {
    dp[i][0] = 1;
    for (int j = (1); j <= (n); j++) {
      dp[i][j] = Add(dp[i - 1][j] + dp[i - 2][j - 1]);
    }
  }
  vector<int> res(n + 1, 0);
  res[0] = 1;
  for (auto i : now) {
    vector<int> now(n + 1, 0);
    for (int j = (0); j <= (n); j++) {
      int v = res[j];
      if (!v) continue;
      for (int k = (0); k <= (i); k++) {
        int u = dp[i][k];
        if (!u) continue;
        Add(now[j + k], (long long)v * u % mod);
      }
    }
    swap(res, now);
  }
  return res;
}
int main() {
  n = read(), m = read(), q = read() * 2;
  prework(max(n, m));
  int rr = n, cc = m;
  while (q--) {
    int x = read(), y = read();
    if (!vr[x]) rr--;
    if (!vc[y]) cc--;
    vr[x] = 1, vc[y] = 1;
  }
  vector<int> a = solve(vr, n);
  vector<int> b = solve(vc, m);
  int ans = 0;
  for (int i = (0); i <= (n); i++)
    for (int j = (0); j <= (m); j++) {
      int t = (long long)a[i] * b[j] % mod;
      if (!t) continue;
      Add(ans, (long long)t * Fac[i] % mod * Fac[j] % mod * C(rr - 2 * i, j) %
                   mod * C(cc - 2 * j, i) % mod);
    }
  cout << ans << endl;
  return 0;
}