import itertools as iter import collections as coll import heapq as hq import bisect as bis from decimal import Decimal as dec from functools import cmp_to_key import math import sys #import pypyjit #pypyjit.set_param('max_unroll_recursion=-1') sys.setrecursionlimit(10 ** 6) inp = sys.stdin.readline input = lambda : inp()[:-1] getN = lambda : int(inp()) getNs = lambda : map(int, inp().split()) getList = lambda :list(map(int, inp().split())) getStrs = lambda n : [input() for _ in [0] * n] getEdges = lambda n : [[x - 1 for x in getNs()] for _ in [0] * n] def yexit(): print("Yes"); exit(0) def nexit(): print("No"); exit(0) pi = 3.141592653589793 mod = 1000000007 MOD = 998244353 INF = 4611686018427387903 dx = [1, 0, -1, 0]; dy = [0, 1, 0, -1] #di = coll.defaultdict(int) def nPk(n, k): ret = 1 for i in range(n, n - k, -1): ret *= i ret %= MOD return ret """ Main Code """ N, M, K = getNs() edges = getEdges(K) A = set([]) for x, y in edges: A |= set([x, y]) t = len(A) id_A = { x : i for i, x in enumerate(sorted(A)) } graph = [[0] * t for _ in [0] * t] for x, y in edges: graph[id_A[x]][id_A[y]] = 1 def can_set_left(s, i): for j in range(t): if not((s >> j) & 1 and graph[j][i]): continue return False return True dp = [-1] * (1 << t) dp[0] = 1 def count_toposo(s): if(dp[s] == -1): dp[s] = 0 for i in range(t): if not((s >> i) & 1 and can_set_left(s, i)): continue dp[s] += count_toposo(s - (1 << i)) dp[s] %= MOD return dp[s] ans = 0 p1 = nPk(N - 1, N - t) p2 = nPk(N - 1, N - t - 1) for i in range(M, N): if(i in A): id = id_A[i] if not(can_set_left((1 << t) - 1, id)): continue ans += p1 * count_toposo((1 << t) - 1 - (1 << id)) % MOD else: ans += p2 * count_toposo((1 << t) - 1) % MOD ans %= MOD print(ans)