import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); int k = sc.nextInt(); int q = sc.nextInt(); int[] row = new int[(int)n]; int[] column = new int[(int)n]; int r = 0; int c = 0; 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() - 1; C[i] = sc.nextInt() - 1; } long[] ans = new long[k]; for(int i = q - 1; i >= 0; i--) { if(a[i].equals("R")) { if(row[B[i]] == 1) { } else { row[B[i]]++; r++; ans[C[i]] += (n - c); } } else { if(column[B[i]] == 1) { } else { column[B[i]]++; c++; ans[C[i]] += (n - r); } } } long sum = 0; for(int i = 0; i < k; i++) { sum += ans[i]; } ans[0] += (n * n - sum); for(int i = 0; i < k; i++) { System.out.println(ans[i]); } } }