#!/usr/bin/env python3.8 import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines MOD = 10 ** 8 + 7 H, W, N = map(int, readline().split()) m = map(int, read().split()) AB = tuple(zip(m, m)) U = 2 * 10 ** 5 + 10 fact = [1] * U for n in range(1, U): fact[n] = n * fact[n - 1] % MOD fact_inv = [1] * U fact_inv[-1] = pow(fact[-1], MOD - 2, MOD) for n in range(U - 1, 0, -1): fact_inv[n - 1] = fact_inv[n] * n % MOD def f(S): XY = sorted((x, y) for i, (x, y) in enumerate(AB) if (S >> i) & 1) x, y = 0, 0 ret = 1 for x1, y1 in XY: dx = x1 - x dy = y1 - y if dx < 0 or dy < 0: return 0 ret *= fact[dx + dy] * fact_inv[dx] * fact_inv[dy] ret %= MOD x = x1 y = y1 dx = H - x dy = W - y ret *= fact[dx + dy] * fact_inv[dx] * fact_inv[dy] return ret % MOD def mobius(dp): for i in range(N): for n in range(1 << N): if n & (1 << i): dp[n ^ (1 << i)] -= dp[n] return def zeta(dp): for i in range(N): for n in range(1 << N): if n & (1 << i): dp[n] += dp[n ^ (1 << i)] return dp = [f(S) for S in range(1 << N)] mobius(dp) zeta(dp) dp = (x % MOD for x in dp[::-1]) print('\n'.join(map(str, dp)))