#include "bits/stdc++.h" using namespace std; #define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i)) #define rep(i,j) FOR(i,0,j) #define each(x,y) for(auto &(x):(y)) #define mp make_pair #define mt make_tuple #define all(x) (x).begin(),(x).end() #define debug(x) cout<<#x<<": "<<(x)< pii; typedef vector vi; typedef vector vll; const int R = 100005; char A[R]; int N, K, Q, B[R], C[R], row[R], col[R]; int main(){ ios::sync_with_stdio(false); cin.tie(0); cin >> N >> K >> Q; rep(i, Q)cin >> A[i] >> B[i] >> C[i]; vll cnt(K); int rr = N, cc = N; for (int i = Q - 1; i >= 0; --i) { char a = A[i]; int b = B[i], c = C[i] - 1; if (a == 'R') { if (!row[b]++) { cnt[c] += cc; rr--; } } else { if (!col[b]++) { cnt[c] += rr; cc--; } } } ll rem = (ll)N*N-accumulate(all(cnt),0ll); cnt[0] += rem; each(c, cnt)cout << c << endl; }