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 nmax = 3600 + 42, mod = 998244353;
bool blocked_row[nmax], blocked_column[nmax];
int h, w, n;
int pointer_row;
int pointer_column;
int rows[nmax][nmax], columns[nmax][nmax];
int c[nmax][nmax];
int ask_c(int n_, int k_) {
  if (n_ < k_ || n_ < 0 || k_ < 0) return 0;
  return c[n_][k_];
}
int fact[nmax];
int main() {
  scanf("%i%i%i", &h, &w, &n);
  for (int i = 1; i <= n; i++) {
    int x1, y1, x2, y2;
    scanf("%i%i%i%i", &x1, &y1, &x2, &y2);
    blocked_row[x1] = 1;
    blocked_row[x2] = 1;
    blocked_column[y1] = 1;
    blocked_column[y2] = 1;
  }
  for (int i = 1; i <= h; i++)
    if (blocked_row[i] == 0) pointer_row++;
  for (int j = 1; j <= w; j++)
    if (blocked_column[j] == 0) pointer_column++;
  rows[0][0] = 1;
  for (int i = 1; i <= h; i++) {
    rows[i][0] = 1;
    for (int groups = 1; groups * 2 <= i; groups++) {
      rows[i][groups] = rows[i - 1][groups];
      if (i >= 2 && blocked_row[i] == 0 && blocked_row[i - 1] == 0) {
        rows[i][groups] = (rows[i][groups] + rows[i - 2][groups - 1]) % mod;
      }
    }
  }
  columns[0][0] = 1;
  for (int j = 1; j <= w; j++) {
    columns[j][0] = 1;
    for (int groups = 1; groups * 2 <= j; groups++) {
      columns[j][groups] = columns[j - 1][groups];
      if (j >= 2 && blocked_column[j] == 0 && blocked_column[j - 1] == 0) {
        columns[j][groups] =
            (columns[j][groups] + columns[j - 2][groups - 1]) % mod;
      }
    }
  }
  for (int i = 0; i <= max(w, h); i++)
    for (int j = 0; j <= i; j++)
      if (j == 0 || j == i)
        c[i][j] = 1;
      else
        c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % mod;
  fact[0] = 1;
  for (int i = 1; i <= max(w, h); i++) fact[i] = 1LL * fact[i - 1] * i % mod;
  long long outp = 0;
  for (int i = 0; i <= pointer_row; i++)
    for (int j = 0; j <= pointer_column; j++)
      if (rows[h][i] && columns[w][j]) {
        long long cur = rows[h][i];
        cur = cur * columns[w][j] % mod;
        cur = cur * ask_c(pointer_column - 2 * j, i) % mod;
        cur = cur * ask_c(pointer_row - 2 * i, j) % mod;
        cur = cur * fact[i] % mod;
        cur = cur * fact[j] % mod;
        outp = (outp + cur) % mod;
      }
  printf("%lld\n", outp);
  return 0;
}