n, k, q = map(int, input().split()) Q = [] for i in range(q): a, b, c = map(str, input().split()) b, c = int(b), int(c) b, c = b-1, c-1 Q.append((a, b, c)) Q.reverse() usedR = set() usedC = set() C = [0]*k for a, b, c in Q: if a == 'R': if b not in usedR: C[c] += n-len(usedC) usedR.add(b) else: if b not in usedC: C[c] += n-len(usedR) usedC.add(b) C[0] += n**2-sum(C) print(*C, sep='\n')