import sys input = sys.stdin.readline from collections import * H, W, Q = map(int, input().split()) ans = H*W d = defaultdict(lambda: H+1) for _ in range(Q): Y, X = map(int, input().split()) if Y