#include #include #include #include #include #include #include #include #include #include #include #define INF 1000000000ll #define MOD 1000000007ll #define EPS 1e-10 #define REP(i,m) for(long long i=0; i P; typedef long double ld; int main() { cin.tie(0); ios::sync_with_stdio(false); ll n,k,q; cin>>n>>k>>q; vector cnt(k,0); vector> abc(q); REP(i,q) cin>>abc[i].first>>abc[i].second.first>>abc[i].second.second; reverse(ALL(abc)); ll rc=0,cc=0; vector r(n,false); vector c(n,false); REP(i,q) { if(abc[i].first=='R') { if(r[abc[i].second.first-1]) continue; cnt[abc[i].second.second-1]+=n-cc; rc++; r[abc[i].second.first-1]=true; } else { if(c[abc[i].second.first-1]) continue; cnt[abc[i].second.second-1]+=n-rc; cc++; c[abc[i].second.first-1]=true; } } ll buf=n*n; REP(i,k) buf-=cnt[i]; cnt[0]+=buf; REP(i,k) cout<