#include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair P; #define fi first #define se second #define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++) #define rep(i,n) repl(i,0,n) #define each(itr,v) for(auto itr:v) #define pb push_back #define all(x) (x).begin(),(x).end() #define dbg(x) cout<<#x"="<y?x:y) #define mmin(x,y) (x>n>>k>>q; rep(i,q){ char c; ll a,b; cin>>c>>a>>b; a--; b--; if(c=='R'){ qa[i]=0; qb[i]=a; qc[i]=b; }else{ qa[i]=1; qb[i]=a; qc[i]=b; } } ll nr=n,nc=n; for(ll i=q-1;i>=0;i--){ if(qa[i]==0&&!r_used[qb[i]]){ r_used[qb[i]]=true; res[qc[i]]+=nc; nr--; }else if(qa[i]==1&&!c_used[qb[i]]){ c_used[qb[i]]=true; res[qc[i]]+=nr; nc--; } } res[0]+=nr*nc; rep(i,k)cout<