#!/usr/bin/env python3 # %% import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines # %% N, K, Q = map(int, readline().split()) query = readlines() # %% color_cnt = [0] * (K + 1) rest_row = [True] * (N + 1) rest_col = [True] * (N + 1) rest_row_cnt = N rest_col_cnt = N # %% for q in query[::-1]: a, b, c = q.split() b = int(b) c = int(c) if a == b'R' and rest_row[b]: color_cnt[c] += rest_col_cnt rest_row[b] = False rest_row_cnt -= 1 if a == b'C' and rest_col[b]: color_cnt[c] += rest_row_cnt rest_col[b] = False rest_col_cnt -= 1 # %% color_cnt[1] += N * N - sum(color_cnt) print('\n'.join(map(str, color_cnt[1:])))