#include using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n, k, q; cin >> n >> k >> q; vector > v; for (int i = 0; i < q; i++) { char a; int b, c; cin >> a >> b >> c; v.emplace_back(a, --b, --c); } vector cnt(k); vector rused(n), cused(n); long long nr = n; long long nc = n; for (int i = q-1; i >= 0; i--) { char a; int b, c; tie(a, b, c) = v[i]; if (a == 'R') { if (!rused[b]) { rused[b] = true; cnt[c] += nc; --nr; } } else { if (!cused[b]) { cused[b] = true; cnt[c] += nr; --nc; } } } cnt[0] += nr * nc; for (int i = 0; i < k; i++) cout << cnt[i] << endl; return 0; }