#include using namespace std; using int64 = long long; int main() { int N, K, Q; char A[100000]; int B[100000], C[100000]; int row[100000], rowlazy = 0; int col[100000], collazy = 0; int64 ans[100000]; cin >> N >> K >> Q; for(int i = 0; i < Q; i++) { cin >> A[i] >> B[i] >> C[i]; --B[i], --C[i]; } for(int i = 0; i < N; i++) { row[i] = col[i] = N; } for(int i = Q - 1; i >= 0; i--) { if(A[i] == 'R') { if(row[B[i]] - rowlazy > 0) { ans[C[i]] += row[B[i]] - rowlazy; row[B[i]] = 0; ++collazy; } } else { if(col[B[i]] - collazy > 0) { ans[C[i]] += col[B[i]] - collazy; col[B[i]] = 0; ++rowlazy; } } } int64 rest = 1LL * N * N; for(int i = 0; i < K; i++) { rest -= ans[i]; } ans[0] += rest; for(int i = 0; i < K; i++) { cout << ans[i] << endl; } }