n, k, Q = map(int, input().split()) query = [input().split() for _ in range(Q)] h = n w = n se_h = set() se_w = set() ans = [0] * k for a, b, c in query[::-1]: b = int(b) c = int(c) - 1 if a == "R": if b in se_h: continue se_h.add(b) h -= 1 ans[c] += w else: if b in se_w: continue se_w.add(b) w -= 1 ans[c] += h ans[0] = n * n - sum(ans[1:]) print(*ans, sep="\n")