import sys input = sys.stdin.readline MOD = 998244353 N, M, K = map(int, input().split()) edges = [[x - 1 for x in map(int, input().split())] for _ in [0] * K] st = set([]) for edge in edges: st |= set(edge) lis = list(st) di = { x : i for i, x in enumerate(lis)} t = len(lis) graph = [[0] * t for _ in [0] * t] for x, y in edges: graph[di[x]][di[y]] = 1 dp = [-1] * (1 << t) dp[0] = 1 def calc_dp(s): global dp if(dp[s] == -1): dp[s] = 0 for i in range(t): if not((s >> i) & 1): continue if all(i == j or not((s >> j) & 1) or graph[j][i] == 0 for j in range(t)): dp[s] += calc_dp(s - (1 << i)) dp[s] %= MOD return dp[s] def nPk(n, k): ret = 1 for i in range(n, n - k, -1): ret *= i ret %= MOD return ret ans = nPk(N, N - t) * calc_dp((1 << t) - 1) % MOD p1 = nPk(N - 1, N - t) p2 = nPk(N - 1, N - t - 1) for i in range(M): if(i in st): id = di[i] if any(id != j and graph[j][id] == 1 for j in range(t)): continue ans -= p1 * calc_dp((1 << t) - 1 - (1 << id)) % MOD else: ans -= p2 * calc_dp((1 << t) - 1) % MOD ans %= MOD print(ans)