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.*;
import java.util.*;

public class F implements Runnable {
	public static void main (String[] args) {new Thread(null, new F(), "_cf", 1 << 28).start();}

	int MAX = 4000;
	int[] fact, invFact;
	
	public void run() {
		FastScanner fs = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		System.err.println("");

		int H = fs.nextInt(), W = fs.nextInt();
		int N = fs.nextInt();
		
		int[] rowMarked = new int[H+1];
		int[] colMarked = new int[W+1];
		for(int i = 0; i < N; i++) {
			int r1 = fs.nextInt(), c1 = fs.nextInt();
			int r2 = fs.nextInt(), c2 = fs.nextInt();
			rowMarked[r1] = rowMarked[r2] = 1;
			colMarked[c1] = colMarked[c2] = 1;
		}
		
		int markedRows = 0, markedCols = 0;
		for(int i : rowMarked) if(i == 1) markedRows++;
		for(int i : colMarked) if(i == 1) markedCols++;
		
		int[][] waysRow = buildWays(H, rowMarked);
		int[][] waysCol = buildWays(W, colMarked);
		
		setFact();
		
		int res = 0;
		for(int addH = 0; addH <= H; addH++) {
			for(int addV = 0; addV <= W; addV++) {
				if(H-2*addV < 0) continue;
				if(W-2*addH < 0) continue;
				int goodRows = waysRow[H][addV];
				goodRows = mult(goodRows, nChooseK(H-2*addV-markedRows, addH));
				int goodCols = waysCol[W][addH];
				goodCols = mult(goodCols, nChooseK(W-2*addH-markedCols, addV));
				
				
				int totWays = mult(goodRows, goodCols);
				totWays = mult(totWays, mult(fact[addH], fact[addV]) );
				
//				System.out.println(addH + " " + addV + " " + goodRows + " " + goodCols + " : " + totWays);
				res = add(res, totWays);
			}
		}
		
		out.println(res);
		
		out.close();
	}
	
	int[][] buildWays(int H, int[] rowMarked) {
		int[][] waysRow = new int[H+1][H+1];
		waysRow[0][0] = 1;
		for(int row = 1; row <= H; row++) {
			for(int piece = 0; piece <= H; piece++) {
				waysRow[row][piece] = add(waysRow[row][piece], waysRow[row-1][piece]);
				if(piece > 0 && row > 1 && rowMarked[row] == 0 && rowMarked[row-1] == 0) {
					waysRow[row][piece] = add(waysRow[row][piece], waysRow[row-2][piece-1]);
				}
			}
		}
		return waysRow;
	}
	
	int nChooseK(int n, int k) {
		if(k < 0 || k > n) return 0;
		int den = mult(invFact[k], invFact[n-k]);
		return mult(fact[n], den);
	}
	
	int MOD = 998244353;
	int add(int a, int b) {
		a += b;
		if(a >= MOD) a -= MOD;
		return a;
	}
	
	int mult(long a, long b) {
		a *= b;
		if(a >= MOD) a %= MOD;
		return (int)a;
	}
	
	void setFact() {
		fact = new int[MAX];
		fact[0] = 1;
		for(int i = 1; i < MAX; i++) {
			fact[i] = mult(i, fact[i-1]);
		}
		
		int[] invs = new int[MAX];
		invs[0] = invs[1] = 1;
		for (int i = 2; i < invs.length; ++i) {
			int temp = MOD - (MOD / i);
			temp = mult(temp, invs[MOD%i]);
			invs[i] = temp;
		}
		
		invFact = new int[MAX];
		invFact[0] = invs[0];
		for(int i = 1; i < MAX; i++) {
			invFact[i] = mult(invFact[i-1], invs[i]);
		}
	}

	class FastScanner {
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public FastScanner() {
			in = new BufferedInputStream(System.in, BS);
		}

		public FastScanner(String s) {
			try {
				in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
			}
			catch (Exception e) {
				in = new BufferedInputStream(System.in, BS);
			}
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}                
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}
		
		public int[] nextIntArray(int n) {
			int[] res = new int[n];
			for(int i = 0; i < n; i++) res[i] = nextInt();
			return res;
		}
		
	}

}