import java.util.*; 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(); int[] row = new int[n]; int[] column = new 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; } int[] ans = new int[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++; column[C[i]] += (n - r); } } } for(int i = 0; i < k; i++) { System.out.println(ans[i]); } } }