N, K, Q = map(int, input().split()) A = [] B = [] C = [] for _ in range(Q): line = input().split() A.append(line[0]) B.append(int(line[1]) - 1) C.append(int(line[2]) - 1) counts = [0 for _ in range(K)] columns_flg = [False for _ in range(N)] rows_flg = [False for _ in range(N)] columns = N rows = N for i in range(Q - 1, -1, -1): if A[i] == 'C': if not columns_flg[B[i]]: counts[C[i]] += columns columns_flg[B[i]] = True rows -= 1 else: if not rows_flg[B[i]]: counts[C[i]] += rows rows_flg[B[i]] = True columns -= 1 counts[0] += N * N - sum(counts) for count in counts: print(count)