#include using LL = long long; const int N = 20; const int M = 2e5 + 7; const int S = 1 << N; const int MOD = 1e8 + 7; struct dat { int x, y, id; bool operator < (const dat &o) const { return x != o.x ? x < o.x : y < o.y; } }; dat a[N]; int f[S], g[S], n, h, w, fac[M], ivf[M]; int pow(int x, int y) { int ret = 1; while(y) { if(y & 1) ret = 1LL * ret * x % MOD; x = 1LL * x * x % MOD; y >>= 1; } return ret; } int get(int x, int y) { return x < 0 || y < 0 ? 0 : 1LL * fac[x + y] * ivf[x] % MOD * ivf[y] % MOD; } int main() { fac[0] = 1, ivf[0] = 1; for(int i = 1; i < M; ++i) { fac[i] = 1LL * fac[i - 1] * i % MOD; ivf[i] = pow(fac[i], MOD - 2); } scanf("%d%d%d", &h, &w, &n); for(int i = 0; i < n; ++i) { scanf("%d%d", &a[i].x, &a[i].y); a[i].id = i; } std::sort(a, a + n); f[0] = 1; for(int i = 0; i < (1 << n); ++i) { int x = 0, y = 0, p = -1, s = 0; for(int j = 0; j < n; ++j) if(i >> j & 1) { s |= 1 << a[j].id; x = a[j].x, y = a[j].y, p = j; } for(int j = p + 1; j < n; ++j) f[i | (1 << j)] = 1LL * f[i] * get(a[j].x - x, a[j].y - y) % MOD; g[s] = 1LL * f[i] * get(h - x, w - y) % MOD; } for(int i = 0; i < n; ++i) for(int j = 0; j < (1 << n); ++j) if(~j >> i & 1) g[j] = (g[j] + MOD - g[j ^ (1 << i)]) % MOD; for(int i = 0; i < n; ++i) for(int j = 0; j < (1 << n); ++j) if(j >> i & 1) g[j] = (g[j] + g[j ^ (1 << i)]) % MOD; int u = (1 << n) - 1; for(int i = 0; i < (1 << n); ++i) printf("%d\n", g[u ^ i]); return 0; }