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;
namespace mine {
long long qread() {
  long long ans = 0, f = 1;
  char c = getchar();
  while (c < '0' or c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while ('0' <= c and c <= '9') ans = ans * 10 + c - '0', c = getchar();
  return ans * f;
}
void write(long long num) {
  if (num < 0) putchar('-'), num = -num;
  if (num >= 10) write(num / 10);
  putchar('0' + num % 10);
}
void write1(long long num) {
  write(num);
  putchar(' ');
}
void write2(long long num) {
  write(num);
  putchar('\n');
}
template <typename T>
void chmax(T &x, const T y) {
  x = (x > y ? x : y);
}
template <typename T>
void chmin(T &x, const T y) {
  x = (x < y ? x : y);
}
long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; }
const int INF = 0x3f3f3f3f;
const int MOD = 998244353;
int mm(const int x) { return x >= MOD ? x - MOD : x; }
template <typename T>
void add(T &x, const T &y) {
  x = (x + y >= MOD ? x + y - MOD : x + y);
}
long long qpower(long long x, long long e, int mod = MOD) {
  long long ans = 1;
  if (e < 0) {
    puts("error");
    exit(666);
  }
  while (e) {
    if (e & 1) ans = ans * x % mod;
    x = x * x % mod;
    e >>= 1;
  }
  return ans;
}
long long invm(long long x) { return qpower(x, MOD - 2); }
const int N = 4e3 + 10;
long long fac[N], facinv[N];
int f[N][N], g[N][N];
bool use1[N], use2[N];
void main() {
  fac[0] = 1;
  for (int i = (1), I = (N - 1); i <= I; i++) fac[i] = fac[i - 1] * i % MOD;
  facinv[N - 1] = invm(fac[N - 1]);
  for (int i = (N - 2), I = (0); i >= I; i--)
    facinv[i] = facinv[i + 1] * (i + 1) % MOD;
  int n = qread(), m = qread();
  int left1 = n, left2 = m;
  int t = qread();
  while (t--) {
    int x1 = qread(), y1 = qread(), x2 = qread(), y2 = qread();
    use1[x1] = use1[x2] = 1;
    left1 -= 1 + (x1 != x2);
    use2[y1] = use2[y2] = 1;
    left2 -= 1 + (y1 != y2);
  }
  f[0][0] = f[1][0] = 1;
  for (int i = (2), I = (n); i <= I; i++)
    for (int cnt = (0), I = (i / 2); cnt <= I; cnt++)
      f[i][cnt] =
          mm(f[i - 1][cnt] +
             (cnt and !use1[i] and !use1[i - 1] ? f[i - 2][cnt - 1] : 0));
  g[0][0] = g[1][0] = 1;
  for (int i = (2), I = (m); i <= I; i++)
    for (int cnt = (0), I = (i / 2); cnt <= I; cnt++)
      g[i][cnt] =
          mm(g[i - 1][cnt] +
             (cnt and !use2[i] and !use2[i - 1] ? g[i - 2][cnt - 1] : 0));
  long long ans = 0;
  for (int i = (0), I = (left1 / 2); i <= I; i++)
    for (int j = (0), I = (left2 / 2); j <= I; j++)
      if (left2 - j - j - i >= 0 and left1 - i - i - j >= 0)
        add(ans, fac[left2 - j - j] * facinv[left2 - j - j - i] % MOD *
                     fac[left1 - i - i] % MOD * facinv[left1 - i - i - j] %
                     MOD * f[n][i] % MOD * g[m][j] % MOD);
  write(ans);
}
};  // namespace mine
signed main() {
  srand(time(0));
  mine::main();
}