#include <bits/stdc++.h>
using namespace std;
int main()
{
set<int> v;
set<int> h;
set<int>::iterator it;
multiset<int> v1;
multiset<int> h1;
int m1[200005];
int m2[200005];
multiset<int>::iterator it1,it2;
int i;
int n;
int l;
int b;
int x;
char c;
int frst;
int last;
cin>>b>>l>>n;
m1[0] = l;
m2[0] = b;
v.insert(0);
h.insert(0);
v1.insert(b);
h1.insert(l);
while(n--) {
scanf(" %c%d",&c,&x);
if(c == 'H') {
x = l-x;
it = lower_bound(h.begin(),h.end(),x);
//cout<<"sss"<<endl;
it--;
frst = *it;
last = m1[frst];
// cout<<frst<<' '<<last<<endl;
h.erase(it);
//cout<<frst<<' '<<last-x<<' '<<last-x<<' '<<last<<endl;
h.insert(frst);
m1[frst] = x;
h.insert(x);
m1[x] = last;
it1 = find(h1.begin(),h1.end(),last-frst);
h1.erase(it1);
h1.insert(abs(x-frst));
h1.insert(abs(last-x));
}
else {
it = lower_bound(v.begin(),v.end(),x);
it--;
frst = *it;
last = m2[frst];
//cout<<frst<<' '<<last<<endl;
v.erase(it);
//cout<<frst<<' '<<last-x<<' '<<last-x<<' '<<last<<endl;
v.insert(frst);
m2[frst] = x;
v.insert(x);
m2[x] = last;
it1 = find(v1.begin(),v1.end(),last-frst);
v1.erase(it1);
v1.insert(abs(x-frst));
v1.insert(abs(last-x));
}
it1 = v1.end();
it1--;
it2 = h1.end();
it2--;
printf("%I64d\n",(long long)*it1 * (long long)*it2);
}
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpCnsKICAgIHNldDxpbnQ+IHY7CiAgICBzZXQ8aW50PiBoOwogICAgc2V0PGludD46Oml0ZXJhdG9yIGl0OwogICAgbXVsdGlzZXQ8aW50PiB2MTsKICAgIG11bHRpc2V0PGludD4gaDE7CiAgICBpbnQgbTFbMjAwMDA1XTsKICAgIGludCBtMlsyMDAwMDVdOwogICAgbXVsdGlzZXQ8aW50Pjo6aXRlcmF0b3IgaXQxLGl0MjsKICAgIGludCBpOwogICAgaW50IG47CiAgICBpbnQgbDsKICAgIGludCBiOwogICAgaW50IHg7CiAgICBjaGFyIGM7CiAgICBpbnQgZnJzdDsKICAgIGludCBsYXN0OwoKICAgIGNpbj4+Yj4+bD4+bjsKICAgIG0xWzBdID0gbDsKICAgIG0yWzBdID0gYjsKICAgIHYuaW5zZXJ0KDApOwogICAgaC5pbnNlcnQoMCk7CiAgICB2MS5pbnNlcnQoYik7CiAgICBoMS5pbnNlcnQobCk7CgogICAgd2hpbGUobi0tKSB7CiAgICAgICAgc2NhbmYoIiAlYyVkIiwmYywmeCk7CiAgICAgICAgaWYoYyA9PSAnSCcpIHsKICAgICAgICAgICAgeCA9IGwteDsKICAgICAgICAgICAgaXQgPSBsb3dlcl9ib3VuZChoLmJlZ2luKCksaC5lbmQoKSx4KTsKICAgICAgICAgICAgLy9jb3V0PDwic3NzIjw8ZW5kbDsKICAgICAgICAgICAgaXQtLTsKICAgICAgICAgICAgZnJzdCA9ICppdDsKICAgICAgICAgICAgbGFzdCA9IG0xW2Zyc3RdOwogICAgICAgICAgIC8vIGNvdXQ8PGZyc3Q8PCcgJzw8bGFzdDw8ZW5kbDsKICAgICAgICAgICAgaC5lcmFzZShpdCk7CiAgICAgICAgICAgIC8vY291dDw8ZnJzdDw8JyAnPDxsYXN0LXg8PCcgJzw8bGFzdC14PDwnICc8PGxhc3Q8PGVuZGw7CiAgICAgICAgICAgIGguaW5zZXJ0KGZyc3QpOwogICAgICAgICAgICBtMVtmcnN0XSA9IHg7CiAgICAgICAgICAgIGguaW5zZXJ0KHgpOwogICAgICAgICAgICBtMVt4XSA9IGxhc3Q7CiAgICAgICAgICAgIGl0MSA9IGZpbmQoaDEuYmVnaW4oKSxoMS5lbmQoKSxsYXN0LWZyc3QpOwogICAgICAgICAgICBoMS5lcmFzZShpdDEpOwogICAgICAgICAgICBoMS5pbnNlcnQoYWJzKHgtZnJzdCkpOwogICAgICAgICAgICBoMS5pbnNlcnQoYWJzKGxhc3QteCkpOwoKICAgICAgICB9CiAgICAgICAgZWxzZSB7CgogICAgICAgICAgIGl0ID0gbG93ZXJfYm91bmQodi5iZWdpbigpLHYuZW5kKCkseCk7CiAgICAgICAgICAgIGl0LS07CiAgICAgICAgICAgIGZyc3QgPSAqaXQ7CiAgICAgICAgICAgIGxhc3QgPSBtMltmcnN0XTsKICAgICAgICAgICAgLy9jb3V0PDxmcnN0PDwnICc8PGxhc3Q8PGVuZGw7CiAgICAgICAgICAgIHYuZXJhc2UoaXQpOwogICAgICAgICAgICAvL2NvdXQ8PGZyc3Q8PCcgJzw8bGFzdC14PDwnICc8PGxhc3QteDw8JyAnPDxsYXN0PDxlbmRsOwogICAgICAgICAgICB2Lmluc2VydChmcnN0KTsKICAgICAgICAgICAgbTJbZnJzdF0gPSB4OwogICAgICAgICAgICB2Lmluc2VydCh4KTsKICAgICAgICAgICAgbTJbeF0gPSBsYXN0OwogICAgICAgICAgICBpdDEgPSBmaW5kKHYxLmJlZ2luKCksdjEuZW5kKCksbGFzdC1mcnN0KTsKICAgICAgICAgICAgdjEuZXJhc2UoaXQxKTsKICAgICAgICAgICAgdjEuaW5zZXJ0KGFicyh4LWZyc3QpKTsKICAgICAgICAgICAgdjEuaW5zZXJ0KGFicyhsYXN0LXgpKTsKCiAgICAgICAgfQogICAgICAgIGl0MSA9IHYxLmVuZCgpOwogICAgICAgIGl0MS0tOwogICAgICAgIGl0MiA9IGgxLmVuZCgpOwogICAgICAgIGl0Mi0tOwogICAgICAgIHByaW50ZigiJUk2NGRcbiIsKGxvbmcgbG9uZykqaXQxICogKGxvbmcgbG9uZykqaXQyKTsKCiAgICB9CgoKCgoKCgp9Cg==