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 JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskF solver = new TaskF();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskF {
        static final long MODULO = 998244353;
        static long[] invs;
        static long[] facts;
        static long[] invfacts;

        static {
            int k = (int) 5000;
            invs = new long[k + 2];
            invs[1] = 1;
            for (int i = 2; i <= k + 1; ++i) {
                invs[i] = ((MODULO - (MODULO / i) * (long) invs[(int) (MODULO % i)] % MODULO) % MODULO);
            }
            facts = new long[k + 2];
            invfacts = new long[k + 2];
            facts[0] = 1;
            invfacts[0] = 1;
            for (int i = 1; i <= k + 1; ++i) {
                facts[i] = (facts[i - 1] * (long) i % MODULO);
                invfacts[i] = (invfacts[i - 1] * (long) invs[i] % MODULO);
            }
        }

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int h = in.nextInt();
            int w = in.nextInt();
            int n = in.nextInt();
            boolean[] rowTaken = new boolean[h];
            boolean[] colTaken = new boolean[w];
            for (int i = 0; i < 2 * n; ++i) {
                rowTaken[in.nextInt() - 1] = true;
                colTaken[in.nextInt() - 1] = true;
            }
            int rowFree = 0;
            for (boolean x : rowTaken) if (!x) ++rowFree;
            int colFree = 0;
            for (boolean x : colTaken) if (!x) ++colFree;
            int[] rowWays = findWays(rowTaken);
            int[] colWays = findWays(colTaken);
            long res = 0;
            for (int nr = 0; nr < rowWays.length; ++nr)
                if (rowWays[nr] > 0) {
                    for (int nc = 0; nc < colWays.length && nr + 2 * nc <= colFree && nc + 2 * nr <= rowFree; ++nc)
                        if (colWays[nc] > 0) {
                            res += rowWays[nr] * (long) colWays[nc] % MODULO * facts[rowFree - 2 * nr] % MODULO * invfacts[rowFree - 2 * nr - nc] % MODULO
                                    * facts[colFree - 2 * nc] % MODULO * invfacts[colFree - 2 * nc - nr];
                            res %= MODULO;
                        }
                }
            out.println(res);
        }

        private int[] findWays(boolean[] rowTaken) {
            int[][] ways = new int[3][rowTaken.length / 2 + 1];
            ways[2][0] = 1;
            int cur = -1;
            for (int i = 0; i < rowTaken.length; ++i) {
                cur = i % 3;
                int prev = (i + 2) % 3;
                int pprev = (i + 1) % 3;
                Arrays.fill(ways[cur], 0);
                for (int j = 0; j < ways[cur].length; ++j) {
                    if (ways[prev][j] > 0) {
                        ways[cur][j] += ways[prev][j];
                    }
                    if (ways[pprev][j] > 0 && !rowTaken[i] && !rowTaken[i - 1]) {
                        ways[cur][j + 1] += ways[pprev][j];
                    }
                    if (ways[cur][j] >= MODULO) ways[cur][j] -= MODULO;
                }
            }
            return ways[cur];
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}