import java.io.*; import java.util.*; class Main { public static void main(String[] args) { MyScanner sc = new MyScanner(); out = new PrintWriter(new BufferedOutputStream(System.out)); int n=sc.nextInt(); int k=sc.nextInt(); int q=sc.nextInt(); char[]a=new char[q]; int[]b=new int[q],c=new int[q]; long[]ans=new long[k]; boolean[]row=new boolean[n],col=new boolean[n]; int nr=n,nc=n; for(int i=0;i<q;++i){ a[i]=sc.next().charAt(0); b[i]=sc.nextInt()-1; c[i]=sc.nextInt()-1; } for(int i=q-1;i>=0;--i){ if(a[i]=='R'){ if(row[b[i]])continue; ans[c[i]]+=nc; nr--; row[b[i]]=true; }else{ if(col[b[i]])continue; ans[c[i]]+=nr; nc--; col[b[i]]=true; } } ans[0]=(long)n*(long)n; for(int i=1;i<k;++i)ans[0]-=ans[i]; for(long aa:ans)out.println(aa); out.close(); } // http://codeforces.com/blog/entry/7018 //-----------PrintWriter for faster output--------------------------------- public static PrintWriter out; //-----------MyScanner class for faster input---------- public static class MyScanner { BufferedReader br; StringTokenizer st; public MyScanner() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String nextLine(){ String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } } }