#include <cstring>
#include <cstdio>
using ll = long long;
constexpr int MOD = 1e9 + 7;
constexpr int dx[] = {1, -1, 0, 0}, dy[] = {0, 0, 1, -1};
int app_x[1000005], app_y[1000005], idx_x[1000005], idx_y[1000005];
int px[65], py[65], dis[65][65], que[100005], sz_x[65], sz_y[65], ans;
bool ban[65][65];
void compress(int n, int m, int k, int *app, int *idx, int *sz)
{
	sz[0] = 1;
	int u = m - app[0], d = ((ll)n * m - k - u) % MOD;
	for (int i = 1; i < n; i++)
	{
		idx[i] = idx[i - 1];
		if (!app[i] && !app[i - 1])
			ans = (ans + (ll)2 * u * d) % MOD;
		else
			idx[i]++;
		sz[idx[i]]++;
		u = (u + m - app[i]) % MOD;
		d = (d + app[i] - m + MOD) % MOD;
	}
}
inline int calc(int x, int y) { return (ll)sz_x[x] * sz_y[y] % MOD; }
inline void bfs(int n, int m, int sx, int sy)
{
	memset(dis, 0x3f, sizeof(dis));
	int he = 0, ta = 0;
	que[ta++] = sx;
	que[ta++] = sy;
	dis[sx][sy] = 0;
	while (he < ta)
	{
		int x = que[he++], y = que[he++];
		ans = (ans + (ll)calc(x, y) * calc(sx, sy) % MOD * dis[x][y]) % MOD;
		for (int i = 0; i < 4; i++)
		{
			int xx = x + dx[i], yy = y + dy[i];
			if (xx < 0 || xx >= n || yy < 0 || yy >= m)
				continue;
			if (!ban[xx][yy] && dis[xx][yy] > 1e9)
			{
				dis[xx][yy] = dis[x][y] + 1;
				que[ta++] = xx;
				que[ta++] = yy;
			}
		}
	}
}
int main()
{
	// freopen("J.in", "r", stdin);
	int n, m, k;
	scanf("%d%d%d", &n, &m, &k);
	for (int i = 0; i < k; i++)
	{
		scanf("%d%d", px + i, py + i);
		app_x[px[i]]++;
		app_y[py[i]]++;
	}
	compress(n, m, k, app_x, idx_x, sz_x);
	compress(m, n, k, app_y, idx_y, sz_y);
	for (int i = 0; i < k; i++)
		ban[idx_x[px[i]]][idx_y[py[i]]] = true;
	for (int i = 0; i <= idx_x[n - 1]; i++)
	{
		for (int j = 0; j <= idx_y[m - 1]; j++)
		{
			if (!ban[i][j])
				bfs(idx_x[n - 1] + 1, idx_y[m - 1] + 1, i, j);
		}
	}
	printf("%lld\n", (ll)ans * (MOD + 1) / 2 % MOD);
	return 0;
}
