import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int K = sc.nextInt(); int Q = sc.nextInt(); String[] A = new String[Q]; int[] B = new int[Q]; int[] C = new int[Q]; for (int i = 0; i < Q; ++i) { A[i] = sc.next(); B[i] = sc.nextInt(); C[i] = sc.nextInt(); --B[i]; --C[i]; } long[] ans = new long[K]; boolean[] column = new boolean[N]; boolean[] row = new boolean[N]; int cnt_column = 0, cnt_row = 0; for (int i = Q - 1; i >= 0; --i) { if (A[i].equals("R")) { if (row[B[i]]) continue; row[B[i]] = true; ans[C[i]] += N - cnt_row; ++cnt_column; } else { if (column[B[i]]) continue; column[B[i]] = true; ans[C[i]] += N - cnt_column; ++cnt_row; } } ans[0] = (long) N * N; for (int i = 1; i < K; ++i) ans[0] -= ans[i]; for (int i = 0; i < K; ++i) { System.out.println(ans[i]); } } static void tr(Object... objects) { System.out.println(Arrays.deepToString(objects)); } }