#include using namespace std; typedef long long ll; typedef pair PII; const int MM = 1e9 + 7; const double eps = 1e-8; const int MAXN = 2e5 + 10; int n, m; void prework(){ } void read(){ } int r[MAXN], c[MAXN], rt[MAXN], ct[MAXN]; int z[MAXN], X[MAXN], Y[MAXN]; ll ans[MAXN]; int visr[MAXN], visc[MAXN]; void solve(int casi){ // cout << "Case #" << casi << ": "; int Q; scanf("%d%d%d", &n, &m, &Q); for (int i = 1; i <= n; i++){ r[i] = 1, rt[i] = 0; c[i] = 1, ct[i] = 0; } for (int i = 1; i <= Q; i++){ char s[10]; int x, y; scanf("%s%d%d", s, &x, &y); if (s[0] == 'R'){ r[x] = y; rt[x] = i; } else{ c[x] = y; ct[x] = i; } z[i] = s[0]=='R'; X[i] = x; Y[i] = y; } for (int i = 1; i <= m; i++) ans[i] = 0; for (int i = 1; i <= n; i++) visr[i] = visc[i] = 0; int R = n, C = n; for (int i = Q; i >= 1; i--){ if (z[i] == 1){ if (visr[X[i]]) ; else ans[Y[i]] += C; R--; visr[X[i]] = 1; } else{ if (visc[X[i]]) ; else ans[Y[i]] += R; C--; visc[X[i]] = 1; } } ans[1] = 1ll * n * n; for (int i = 2; i <= m; i++) ans[1] -= ans[i]; for (int i = 1; i <= m; i++) printf("%lld\n", ans[i]); } void printans(){ } int main(){ // std::ios::sync_with_stdio(false); prework(); int T = 1; // cin>>T; for(int i = 1; i <= T; i++){ read(); solve(i); printans(); } return 0; }