import sys def I(): return int(sys.stdin.readline().rstrip()) def MI(): return map(int,sys.stdin.readline().rstrip().split()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def LI2(): return list(map(int,sys.stdin.readline().rstrip())) def S(): return sys.stdin.readline().rstrip() def LS(): return list(sys.stdin.readline().rstrip().split()) def LS2(): return list(sys.stdin.readline().rstrip()) H,W,k = MI() mod = 10**8+7 friends = [] for _ in range(k): a,b = MI() friends.append((W+1)*a+b) fac = [1] for i in range(1,H+W+1): fac.append((fac[-1]*i) % mod) fac_inv = [0]*(H+W+1) f = pow(fac[-1],mod-2,mod) for i in range(H+W,-1,-1): fac_inv[i] = f f *= i f %= mod def comb(n,r): return fac[n] * fac_inv[r] % mod * fac_inv[n-r] % mod K = 1 << k F = [0]*K for i in range(K): X = [0] for j in range(k): if not (i >> j) & 1: X.append(friends[j]) X.append((W+1)*H+W) f = 1 for j in range(len(X)-1): a0,b0 = divmod(X[j],W+1) a1,b1 = divmod(X[j+1],W+1) if a0 > a1 or b0 > b1: break f *= comb((a1-a0)+(b1-b0),a1-a0) f %= mod else: F[i] = f def mobius_transform(F,n): # res[i] = (iを含む集合jに対する (-1)^(#j-#i)F[j] の和) N = 1 << n res = F[:] for i in range(n): k = 1 << i for j in range(N): if not j & k: res[j] -= res[j^k] return res G = mobius_transform(F,k)[::-1] for g in G: print(abs(g) % mod)