MOD = 998244353 N,M,K = map(int,input().split()) P = {} for _ in range(K): x,y = map(int,input().split()) if x not in P: P[x] = set() if y not in P: P[y] = set() P[y].add(x) V = set(list(P.keys())) listV = list(V) L = len(V) J = 0 for v in P: if v<=M: J += 1 dpf = [0]*(1<>k & 1: S.add(listV[k]) Sc = V-S flag = True for v in S: if not(P[v] <= S): flag = False break if not flag:continue nextV = set() for v in Sc: if P[v] <= S: nextV.add(v) for v in nextV: indv = listV.index(v) dpf[i|1<>k & 1: S.add(listV[k]) Sc = V-S flag = True for v in S: if not(P[v] <= S): flag = False break if not flag:continue nextV = set() for v in Sc: if i==0 and v<=M:continue else: if P[v] <= S: nextV.add(v) for v in nextV: indv = listV.index(v) dpg[i|1<n:return 0 return A[n]*B[k]*B[n-k]%MOD ans = (comb(N-1,L)*f*(N-L-(M-J))*A[N-L-1])%MOD+(comb(N-1,L-1)*g*A[N-L])%MOD ans = ans%MOD print(ans)