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;
template <class T>
void _R(T &x) {
  cin >> x;
}
void _R(int &x) { scanf("%d", &x); }
void _R(long long &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template <class T, class... U>
void R(T &head, U &...tail) {
  _R(head);
  R(tail...);
}
template <class T>
void _W(const T &x) {
  cout << x;
}
void _W(const int &x) { printf("%d", x); }
void _W(const long long &x) { printf("%lld", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template <class T, class U>
void _W(const pair<T, U> &x) {
  _W(x.first);
  putchar(' ');
  _W(x.second);
}
template <class T>
void _W(const vector<T> &x) {
  for (auto i = x.begin(); i != x.end(); _W(*i++))
    if (i != x.cbegin()) putchar(' ');
}
void W() {}
template <class T, class... U>
void W(const T &head, const U &...tail) {
  _W(head);
  putchar(sizeof...(tail) ? ' ' : '\n');
  W(tail...);
}
int MOD = 1e9 + 7;
void ADD(long long &x, long long v) {
  x = (x + v) % MOD;
  if (x < 0) x += MOD;
}
const int SIZE = 3610;
int row[SIZE], col[SIZE];
long long dp_row[SIZE], dp_col[SIZE];
long long tmp[SIZE], C[SIZE][SIZE], fac[SIZE];
int calc(int AA[], long long dp_AA[], int n) {
  int ma = 0;
  dp_AA[0] = 1;
  for (int i = 1, j; i <= n; i = j) {
    if (AA[i]) {
      j = i + 1;
      continue;
    }
    for (j = i + 1; j <= n && !AA[j]; j++)
      ;
    int num = j - i;
    for (int k = num / 2; k > 0; k--) {
      tmp[k] = C[k + (num - k * 2)][k];
    }
    for (int k1 = ma; k1 >= 0; k1--) {
      for (int k2 = num / 2; k2 > 0; k2--) {
        ADD(dp_AA[k1 + k2], dp_AA[k1] * tmp[k2]);
      }
    }
    ma += num / 2;
  }
  return ma;
}
int main() {
  MOD = 998244353;
  C[0][0] = 1;
  for (int i = (1); i < (SIZE); ++i) {
    C[i][0] = 1;
    for (int j = (1); j <= (i); ++j) {
      C[i][j] = C[i - 1][j - 1] + C[i - 1][j];
      if (C[i][j] >= MOD) C[i][j] -= MOD;
    }
  }
  fac[0] = 1;
  for (int i = (1); i < (SIZE); ++i) fac[i] = fac[i - 1] * i % MOD;
  int h, w, n;
  R(h, w, n);
  for (int i = (1); i <= (n); ++i) {
    for (int j = 0; j < (2); ++j) {
      int x, y;
      R(x, y);
      row[x] = 1;
      col[y] = 1;
    }
  }
  int col_zero = count(col + 1, col + w + 1, 0);
  int row_zero = count(row + 1, row + h + 1, 0);
  int row_ma = calc(row, dp_row, h);
  int col_ma = calc(col, dp_col, w);
  long long an = 0;
  for (int i = 0; i <= row_ma && i <= col_zero; i++) {
    if (!dp_row[i]) continue;
    for (int j = 0;
         j <= col_ma && i * 2 + j <= row_zero && i + j * 2 <= col_zero; j++) {
      ADD(an, dp_row[i] * dp_col[j] % MOD * C[row_zero - 2 * i][j] % MOD *
                  C[col_zero - 2 * j][i] % MOD * fac[i] % MOD * fac[j]);
    }
  }
  W(an);
  return 0;
}