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 INF = 1 << 30;
const long long int MAX = 998244353;
void array_show(int *array, int array_n, char middle = ' ') {
  for (int i = 0; i < array_n; i++)
    printf("%d%c", array[i], (i != array_n - 1 ? middle : '\n'));
}
void array_show(long long int *array, int array_n, char middle = ' ') {
  for (int i = 0; i < array_n; i++)
    printf("%lld%c", array[i], (i != array_n - 1 ? middle : '\n'));
}
void array_show(vector<int> &vec_s, char middle = ' ') {
  for (int i = 0; i < vec_s.size(); i++)
    printf("%d%c", vec_s[i], (i != vec_s.size() - 1 ? middle : '\n'));
}
void array_show(vector<long long int> &vec_s, char middle = ' ') {
  for (int i = 0; i < vec_s.size(); i++)
    printf("%lld%c", vec_s[i], (i != vec_s.size() - 1 ? middle : '\n'));
}
long long int pow_mod(long long int p_a, long long int p_n,
                      long long int p_p = 1e9 + 7) {
  long long int p_b = 1, p_t = 1;
  for (; p_b <= p_n; p_b <<= 1)
    ;
  for (p_b >>= 1; p_b > 0; p_b >>= 1) {
    p_t *= p_t;
    if (p_t >= p_p) p_t %= p_p;
    if (p_n & p_b) p_t *= p_a;
    if (p_t >= p_p) p_t %= p_p;
  }
  return p_t;
}
long long int gcd(long long int g_a, long long int g_b) {
  if (g_a < g_b) gcd(g_b, g_a);
  if (g_b == 0) return g_a;
  return gcd(g_b, g_a % g_b);
}
long long int divide(long long int d_a, long long int d_b,
                     long long int d_p = 1e9 + 7, bool prime = true) {
  if (d_a >= d_p) d_a %= d_p;
  if (d_a < 0) d_a += d_p;
  if (d_b >= d_p) d_b %= d_p;
  if (d_b < 0) d_b += d_p;
  if (!prime) {
    long long int d_d = gcd(d_a, d_b);
    if (d_d > 1) d_a /= d_d, d_b /= d_d;
  }
  d_a *= pow_mod(d_b, d_p - 2, d_p);
  return d_a % d_p;
}
long long int dp[2000][5000];
bool used[2][5005];
long long int num[2][5005];
long long int lim[2];
long long int kai[5005];
long long int memo[5000][5000];
long long int calcP(long long int a, long long int b) {
  if (memo[a][b] != -1) return memo[a][b];
  memo[a][b] = divide(kai[a], kai[a - b], MAX);
  return memo[a][b];
}
int main() {
  long long int n, h, w;
  int i, j, k;
  long long int a, b, c;
  cin >> h >> w >> n;
  a = max(h, w);
  for (i = 0; i <= a; i++) {
    b = 1;
    for (j = 0; j <= i; j++) {
      memo[i][j] = b;
      b *= i - j;
      if (b >= MAX) b %= MAX;
    }
  }
  for (i = 0; i < 2 * n; i++) {
    cin >> a >> b;
    a--, b--;
    used[0][a] = true, used[1][b] = true;
  }
  used[0][h] = true, used[1][w] = true;
  long long int m[2] = {h, w};
  for (i = 0; i < 2; i++) {
    memset(dp, 0, sizeof(dp));
    dp[0][0] = 1;
    for (j = 0; j <= m[i] / 2; j++) {
      for (k = 0; k < m[i]; k++) {
        if (dp[j][k] >= MAX) dp[j][k] %= MAX;
        dp[j][k + 1] += dp[j][k];
        if (!dp[j][k]) continue;
        if (used[i][k] || used[i][k + 1]) continue;
        dp[j + 1][k + 2] += dp[j][k];
      }
    }
    for (j = 0; j <= m[i] / 2; j++) {
      num[i][j] = dp[j][m[i]] % MAX;
    }
    for (j = 0; j < m[i]; j++) {
      if (!used[i][j]) lim[i]++;
    }
  }
  long long int s = 0;
  for (i = 0; i <= h / 2; i++) {
    if (i * 2 > lim[0] || i > lim[1]) break;
    for (j = 0; j <= w / 2; j++) {
      if (i * 2 + j > lim[0] || i + j * 2 > lim[1]) break;
      a = memo[lim[0] - i * 2][j] * memo[lim[1] - j * 2][i] % MAX;
      a = a * num[0][i];
      if (a >= MAX) a %= MAX;
      s += a * num[1][j];
      if (s >= MAX) s %= MAX;
    }
  }
  cout << s << endl;
}