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;
int H, W, n;
int visX[4010], visY[4010];
struct point {
  int x, y;
};
vector<int> X, Y;
int D[4010][4010][2], Mod = 998244353;
int Comb[4010][4010], SX, SY;
void Do(vector<int> T, int S, int ck) {
  int i, j, sum = 0, k;
  D[0][0][ck] = 1;
  int sz = T.size();
  for (int i = 1; i <= sz; i++) {
    int t = T[i - 1];
    for (j = 0; j <= sum; j++) {
      int d = D[i - 1][j][ck];
      for (k = 0; k <= t / 2; k++) {
        D[i][j + k][ck] =
            (D[i][j + k][ck] + (long long)d * Comb[t - k][t - k * 2]) % Mod;
      }
    }
    sum += t / 2;
  }
}
int F[4010];
int main() {
  int i, j;
  scanf("%d%d", &H, &W);
  for (i = 0; i <= 4000; i++) {
    Comb[i][0] = 1;
    for (j = 1; j <= i; j++)
      Comb[i][j] = (Comb[i - 1][j - 1] + Comb[i - 1][j]) % Mod;
  }
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    point a, b;
    scanf("%d%d%d%d", &a.x, &a.y, &b.x, &b.y);
    visX[a.x] = visX[b.x] = 1;
    visY[a.y] = visY[b.y] = 1;
  }
  int c = 0;
  for (i = 1; i <= H; i++) {
    if (!visX[i]) c++, SX++;
    if (i == H || visX[i + 1]) {
      if (c) X.push_back(c);
      c = 0;
    }
  }
  c = 0;
  for (i = 1; i <= W; i++) {
    if (!visY[i]) c++, SY++;
    if (i == W || visY[i + 1]) {
      if (c) Y.push_back(c);
      c = 0;
    }
  }
  Do(X, H, 0);
  Do(Y, W, 1);
  long long res = 0;
  F[0] = 1;
  for (i = 1; i <= 4000; i++) {
    F[i] = 1ll * F[i - 1] * i % Mod;
  }
  for (i = 0; i <= SX; i++) {
    for (j = 0; i + j * 2 <= SX; j++) {
      if (i * 2 + j <= SY) {
        int rx = SX - j * 2;
        int ry = SY - i * 2;
        res = (res + 1ll * D[X.size()][j][0] * Comb[rx][i] % Mod *
                         D[Y.size()][i][1] % Mod * Comb[ry][j] % Mod * F[i] %
                         Mod * F[j]) %
              Mod;
      }
    }
  }
  printf("%lld\n", res);
}