#include<stdio.h>
#include<string.h>
#include<math.h>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<stack>
#include<vector>
#include<iostream>
//#include<bits/stdc++.h>
using namespace std;
const int N=3e5+10;
const int inf = 0x3f3f3f3f;
const int mod = 1000007;
//typedef __int64 ll;
typedef long long ll;
vector<ll>leng,wide,len,wid;
vector<ll>::iterator it;
char op[3];
int main()
{
    ll H,W,n;
    scanf("%lld%lld%lld",&H,&W,&n);
    leng.push_back(0);
    leng.push_back(W);//放的是高
    wide.push_back(0);
    wide.push_back(H);//放的是宽
    len.push_back(W);//放的是高的最大值
    wid.push_back(H);//宽的最大值
    for(ll i=0; i<n; i++)
    {
        ll temp,index=-1;
        scanf("%s%lld",op,&temp);
        if(op[0]=='H')//放高度
        {
            index=upper_bound(leng.begin(),leng.end(),temp)-leng.begin();//当前的高度应放的位置
//            cout<<"index is "<<index<<endl;
            ll del=leng[index]-leng[index-1];
            it =lower_bound(len.begin(),len.end(),del);//删除大的区间长度
            len.erase(it);
            if(len.empty())//现在插入这两个小区间长度
            {
                len.push_back(min(leng[index]-temp,temp-leng[index-1]));
                len.push_back(max(leng[index]-temp,temp-leng[index-1]));
                leng.insert(index+leng.begin(),temp);
            }
            else
            {
                ll Min=min(leng[index]-temp,temp-leng[index-1]);
                ll Max=max(leng[index]-temp,temp-leng[index-1]);
                leng.insert(index+leng.begin(),temp);
                if(len[len.size()-1]<=Min)
                {
                    len.push_back(Min);
                    len.push_back(Max);
                }
                else
                {
                    index=upper_bound(len.begin(),len.end(),Min)-len.begin();
                    len.insert(index+len.begin(),Min);
                    if(len[len.size()-1]<=Max)
                        len.push_back(Max);
                    else
                    {
                        index=upper_bound(len.begin(),len.end(),Max)-len.begin();
                        len.insert(index+len.begin(),Max);
                    }
                }
            }
        }
        else
        {
            index=upper_bound(wide.begin(),wide.end(),temp)-wide.begin();//当前的高度应放的位置
            ll del=wide[index]-wide[index-1];
            it =lower_bound(wid.begin(),wid.end(),del);//删除大的区间长度
            wid.erase(it);
            if(wid.empty())//现在插入这两个小区间长度
            {
                wid.push_back(min(wide[index]-temp,temp-wide[index-1]));
                wid.push_back(max(wide[index]-temp,temp-wide[index-1]));
                wide.insert(index+wide.begin(),temp);
            }
            else
            {
                ll Min=min(wide[index]-temp,temp-wide[index-1]);
                ll Max=max(wide[index]-temp,temp-wide[index-1]);
                wide.insert(index+wide.begin(),temp);
                if(wid[wid.size()-1]<=Min)
                {
                    wid.push_back(Min);
                    wid.push_back(Max);
                }
                else
                {
                    index=upper_bound(wid.begin(),wid.end(),Min)-wid.begin();
                    wid.insert(index+wid.begin(),Min);
                    if(wid[wid.size()-1]<=Max)
                        wid.push_back(Max);
                    else
                    {
                        index=upper_bound(wid.begin(),wid.end(),Max)-wid.begin();
                        wid.insert(index+wid.begin(),Max);
                    }
                }
            }
        }
//        for(ll j=0; j<len.size(); j++)
//            printf("%lld ",len[j]);
//        cout<<endl;
//        for(ll j=0; j<wid.size(); j++)
//            printf("%lld ",wid[j]);
//        cout<<endl;
        printf("%lld\n",len[len.size()-1]*wid[wid.size()-1]);
    }
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<math.h>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<stack>
#include<vector>
#include<iostream>
//#include<bits/stdc++.h>
using namespace std;
const int N=3e5+10;
const int inf = 0x3f3f3f3f;
const int mod = 1000007;
//typedef __int64 ll;
typedef long long ll;
vector<ll>leng,wide;
map<ll,ll>len,wid;
map<ll,ll>::iterator it;
char op[3];
int main()
{
    ll H,W,n;
    scanf("%lld%lld%lld",&H,&W,&n);
    leng.push_back(0);
    leng.push_back(W);//放的是高
    wide.push_back(0);
    wide.push_back(H);//放的是宽
    len[W]++;
    wid[H]++;
    for(ll i=0; i<n; i++)
    {
        ll temp,index=-1;
        scanf("%s%lld",op,&temp);
        if(op[0]=='H')//放高度
        {
            index=upper_bound(leng.begin(),leng.end(),temp)-leng.begin();//当前的高度应放的位置
            ll del=leng[index]-leng[index-1];//应删除的大区间
            if(len[del]==1)
                len.erase(del);
            else
                len[del]--;
            ll Min=min(leng[index]-temp,temp-leng[index-1]);
            ll Max=max(leng[index]-temp,temp-leng[index-1]);
            len[Min]++;//插入小区间
            len[Max]++;
            leng.insert(index+leng.begin(),temp);//插入位置
        }
        else
        {
            index=upper_bound(wide.begin(),wide.end(),temp)-wide.begin();//当前的高度应放的位置
            ll del=wide[index]-wide[index-1];
//            printf("del is %lld\n",del);
            if(wid[del]==1)
                wid.erase(del);
            else
                wid[del]--;
//            printf("sucsessful!!\n");
            ll Min=min(wide[index]-temp,temp-wide[index-1]);
            ll Max=max(wide[index]-temp,temp-wide[index-1]);
            wid[Min]++;
            wid[Max]++;
            wide.insert(index+wide.begin(),temp);
        }
        it = len.end(),it--;
        ll length=it->first;
        it = wid.end(),it--;
        ll width = it->first;
//        for(ll j=0; j<leng.size(); j++)
//            printf("%lld ",leng[j]);
//        cout<<endl;
//        for(ll j=0; j<wide.size(); j++)
//            printf("%lld ",wide[j]);
//        cout<<endl;
//        cout<<length<<" "<<width<<endl;
        printf("%lld\n",length*width);
    }
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<math.h>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<list>
#include<stack>
#include<vector>
#include<iostream>
//#include<bits/stdc++.h>
using namespace std;
const int N=3e5+10;
const int inf = 0x3f3f3f3f;
const int mod = 1000007;
//typedef __int64 ll;
typedef long long ll;
set<ll>leng,wide;
map<ll,ll>len,wid;
map<ll,ll>::iterator it;
set<ll>::iterator se;
char op[3];
int main()
{
    ll H,W,n;
    scanf("%lld%lld%lld",&H,&W,&n);
    leng.insert(0);
    leng.insert(W);//放的是高
    wide.insert(0);
    wide.insert(H);//放的是宽
    len[W]++;
    wid[H]++;
    for(ll i=0; i<n; i++)
    {
        ll temp,index=-1;
        scanf("%s%lld",op,&temp);
        if(op[0]=='H')//放高度
        {
            leng.insert(temp);
            se=leng.find(temp);
            se++;
            ll up=*se;
            se--,se--;
            ll down=*se;
            ll del=up-down;//应删除的大区间
            if(len[del]==1)
                len.erase(del);
            else
                len[del]--;
            ll Min=min(up-temp,temp-down);
            ll Max=max(up-temp,temp-down);
            len[Min]++;//插入小区间
            len[Max]++;
        }
        else
        {
            wide.insert(temp);
            se=wide.find(temp);
            se++;
            ll up=*se;
            se--,se--;
            ll down=*se;
            ll del=up-down;//应删除的大区间
            if(wid[del]==1)
                wid.erase(del);
            else
                wid[del]--;
            ll Min=min(up-temp,temp-down);
            ll Max=max(up-temp,temp-down);
            wid[Min]++;//插入小区间
            wid[Max]++;
        }
        it = len.end(),it--;
        ll length=it->first;
        it = wid.end(),it--;
        ll width = it->first;
        printf("%lld\n",length*width);
    }
    return 0;
}


#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC optimize("unroll-loops")
using namespace std;
#ifdef ONLINE_JUDGE
inline char getchar_unlocked() { return _getchar_nolock(); }
#endif
ll read()
{
	char c = getchar_unlocked();
	ll t = 0, f = 1;
	while (c < '0' || '9' < c)
        f = (c == '-' ? -1 : 1), c = getchar_unlocked();
	while ('0' <= c && c <= '9')
        t = t * 10 + c - '0', c = getchar_unlocked();
	return t * f;
}

set<ll> x, y;
multiset<ll> sx, sy;

int main()
{
    ll t = 1, n, m, q, c;
    char cmd;
    while (t--) {
        n = read(), m = read(), q = read();
        x.clear(), y.clear();
        sx.clear(), sy.clear();
        x.insert(0), x.insert(n);
        y.insert(0), y.insert(m);
        sx.insert(n), sy.insert(m);
        while (q--) {
            scanf("%c", &cmd);
            c = read();
            if (cmd == 'H' && !y.count(c)) {
                y.insert(c);
                auto it = y.find(c);
                int y1 = *--it, y2 = *++++it;
                assert(sy.find(y2 - y1) != sy.end());
                sy.erase(sy.find(y2 - y1));
                sy.insert(c - y1), sy.insert(y2 - c);
            } else if (!x.count(c)) {
                x.insert(c);
                auto it = x.find(c);
                int x1 = *--it, x2 = *++++it;
                assert(sx.find(x2 - x1) != sx.end());
                sx.erase(sx.find(x2 - x1));
                sx.insert(c - x1), sx.insert(x2 - c);
            }
            assert(sx.rbegin() != sx.rend());
            assert(sy.rbegin() != sy.rend());
            printf("ll%d\n",*sx.rbegin() * (*sy.rbegin()));
        }
    }
    return 0;
}


#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC optimize("unroll-loops")
using namespace std;
#ifdef ONLINE_JUDGE
inline char getchar_unlocked() { return _getchar_nolock(); }
#endif
int read()
{
	char c = getchar_unlocked();
	int t = 0, f = 1;
	while (c < '0' || '9' < c)
        f = (c == '-' ? -1 : 1), c = getchar_unlocked();
	while ('0' <= c && c <= '9')
        t = t * 10 + c - '0', c = getchar_unlocked();
	return t * f;
}

set<int> x, y;
multiset<int> sx, sy;

int main()
{
    int t = 1, n, m, q, c;
    char cmd;
    while (t--) {
        n = read(), m = read(), q = read();
        x.clear(), y.clear();
        sx.clear(), sy.clear();
        x.insert(0), x.insert(n);
        y.insert(0), y.insert(m);
        sx.insert(n), sy.insert(m);
        while (q--) {
            scanf("%c", &cmd);
            c = read();
            if (cmd == 'H' && !y.count(c)) {
                y.insert(c);
                auto it = y.find(c);
                int y1 = *--it, y2 = *++++it;
                assert(sy.find(y2 - y1) != sy.end());
                sy.erase(sy.find(y2 - y1));
                sy.insert(c - y1), sy.insert(y2 - c);
            } else if (!x.count(c)) {
                x.insert(c);
                auto it = x.find(c);
                int x1 = *--it, x2 = *++++it;
                assert(sx.find(x2 - x1) != sx.end());
                sx.erase(sx.find(x2 - x1));
                sx.insert(c - x1), sx.insert(x2 - c);
            }
            assert(sx.rbegin() != sx.rend());
            assert(sy.rbegin() != sy.rend());
            printf("%d\n",*sx.rbegin() * (*sy.rbegin()));
        }
    }
    return 0;
}


#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC optimize("unroll-loops")
using namespace std;
typedef long long ll;
#ifdef ONLINE_JUDGE
inline char getchar_unlocked() { return _getchar_nolock(); }
#endif
ll read()
{
	char c = getchar_unlocked();
	ll t = 0, f = 1;
	while (c < '0' || '9' < c)
        f = (c == '-' ? -1 : 1), c = getchar_unlocked();
	while ('0' <= c && c <= '9')
        t = t * 10 + c - '0', c = getchar_unlocked();
	return t * f;
}

set<ll> x, y;
multiset<ll> sx, sy;

int main()
{
    ll t = 1, n, m, q, c;
    char cmd;
    while (t--) {
        n = read(), m = read(), q = read();
        x.clear(), y.clear();
        sx.clear(), sy.clear();
        x.insert(0), x.insert(n);
        y.insert(0), y.insert(m);
        sx.insert(n), sy.insert(m);
        while (q--) {
            scanf("%c", &cmd);
            c = read();
            if (cmd == 'H' && !y.count(c)) {
                y.insert(c);
                auto it = y.find(c);
                int y1 = *--it, y2 = *++++it;
                assert(sy.find(y2 - y1) != sy.end());
                sy.erase(sy.find(y2 - y1));
                sy.insert(c - y1), sy.insert(y2 - c);
            } else if (!x.count(c)) {
                x.insert(c);
                auto it = x.find(c);
                int x1 = *--it, x2 = *++++it;
                assert(sx.find(x2 - x1) != sx.end());
                sx.erase(sx.find(x2 - x1));
                sx.insert(c - x1), sx.insert(x2 - c);
            }
            assert(sx.rbegin() != sx.rend());
            assert(sy.rbegin() != sy.rend());
            printf("%lld\n",*sx.rbegin() * (*sy.rbegin()));
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int h,v,n;
    cin>>h>>v>>n;
    multiset<int>wi;
    multiset<int>hi;
    multiset<int>len;
    multiset<int>bre;
    wi.insert(0);
    wi.insert(h);
    hi.insert(0);
    hi.insert(v);
    len.insert(h);
    bre.insert(v);
    for(int i=0;i<n;i++){
        char c;
        int x;
        cin>>c>>x;
        multiset<int>:: iterator r;
        multiset<int>:: iterator l;
        if(c=='H'){
            r=(hi.upper_bound(x));
            l=r;
            l--;
            int val=*r - *l;
            hi.insert(x);
            bre.insert(*r-x);
            bre.insert(x- *l);
            bre.erase(bre.find(val));
        }
        else{
            r=(wi.upper_bound(x));
            l=r;
            l--;
            int val=*r - *l;
            wi.insert(x);
            len.insert(*r-x);
            len.insert(x- *l);
            len.erase(len.find(val));
        }
        cout<<1LL*(*(len.rbegin()) * *(bre.rbegin()))<<"\n";
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int h,v,n;
    cin>>h>>v>>n;
    multiset<int>wi;
    multiset<int>hi;
    multiset<int>len;
    multiset<int>bre;
    wi.insert(0);
    wi.insert(h);
    hi.insert(0);
    hi.insert(v);
    len.insert(h);
    bre.insert(v);
    for(int i=0;i<n;i++){
        char c;
        int x;
        cin>>c>>x;
        multiset<int>:: iterator r;
        multiset<int>:: iterator l;
        if(c=='H'){
            r=(hi.upper_bound(x));
            l=r;
            l--;
            int val=*r - *l;
            hi.insert(x);
            bre.insert(*r-x);
            bre.insert(x- *l);
            bre.erase(bre.find(val));
        }
        else{
            r=(wi.upper_bound(x));
            l=r;
            l--;
            int val=*r - *l;
            wi.insert(x);
            len.insert(*r-x);
            len.insert(x- *l);
            len.erase(len.find(val));
        }
        cout<<*(len.rbegin()) * *(bre.rbegin())<<"\n";
    }
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    ll h,v,n;
    cin>>h>>v>>n;
    multiset<ll>wi;
    multiset<ll>hi;
    multiset<ll>len;
    multiset<ll>bre;
    wi.insert(0);
    wi.insert(h);
    hi.insert(0);
    hi.insert(v);
    len.insert(h);
    bre.insert(v);
    for(int i=0;i<n;i++){
        char c;
        ll x;
        cin>>c>>x;
        multiset<ll>:: iterator r;
        multiset<ll>:: iterator l;
        if(c=='H'){
            r=(hi.upper_bound(x));
            l=r;
            l--;
            ll val=*r - *l;
            hi.insert(x);
            bre.insert(*r-x);
            bre.insert(x- *l);
            bre.erase(bre.find(val));
        }
        else{
            r=(wi.upper_bound(x));
            l=r;
            l--;
            ll val=*r - *l;
            wi.insert(x);
            len.insert(*r-x);
            len.insert(x- *l);
            len.erase(len.find(val));
        }
        cout<<1LL*(*(len.rbegin()) * *(bre.rbegin()))<<"\n";
    }
}


#include <iostream>
#include <set>

using namespace std;

int main()
{
    int width,height,n;
    cin>>width>>height>>n;

    set<int> Vpoints;
    set<int> Hpoints;

    Vpoints.insert(0);
    Vpoints.insert(width);
    Hpoints.insert(0);
    Hpoints.insert(height);

    char orientation;
    int position;

    long long int maxH=height,maxV=width,area;
    for(int i=0;i<n;i++)
    {
        cin>>orientation>>position;
        if(orientation=='H')
        {
            Hpoints.insert(position);
            maxH=0;
            set<int>::iterator it=Hpoints.begin();
            set<int>::iterator it2=Hpoints.begin();
            it2++;

            while(it2!=Hpoints.end())
            {
                if(maxH<*it2-*it)
                {
                    maxH=*it2-*it;
                }
                it2++;
                it++;
            }

        }
        else
        {
            Vpoints.insert(position);
            maxV=0;

            set<int>::iterator it=Vpoints.begin();
            set<int>::iterator it2=Vpoints.begin();
            it2++;

            while(it2!=Vpoints.end())
            {
                if(maxV<*it2-*it)
                {
                    maxV=*it2-*it;
                }
                it2++;
                it++;

            }
        }

        area=maxH*maxV;
        cout<<area<<"\n";
    }
}


#include <iostream>
#include <set>

using namespace std;

/*int main()
{
    int width,height,n,area;
    cin>>width>>height>>n;

    int heightstart=0,heightfinish=height;
    int widthstart=0,widthfinish=width;
    char orientation;
    int position;
    for(int i=0;i<n;i++)
    {
        cin>>orientation>>position;

        if(orientation=='H')
        {
            if(position>=heightstart && position<=heightfinish)
                {
                    if(heightfinish-position>position-heightstart)
                    {
                        heightstart=position-heightstart;
                    }
                    else
                    {
                        heightfinish=position;

                    }

                    height=heightfinish-heightstart;
                }
        }
        else
        {
            if(position>=widthstart && position<=widthfinish)
            {
                if(widthfinish-position>position-widthstart)
                {
                    widthstart=position-widthstart;
                }
                else
                {
                    widthfinish=position;

                }

                width=widthfinish-widthstart;
            }
        }

        //cout<<width<<" "<<height<<"\n";
        //cout<<heightstart<<" "<<heightfinish<<"\n";
        //cout<<widthstart<<" "<<widthfinish<<"\n";

        area=width*height;
        cout<<area<<"\n";

    }
}*/

int main()
{
    int width,height,n;
    cin>>width>>height>>n;

    set<int> Vpoints;
    set<int> Hpoints;

    Vpoints.insert(0);
    Vpoints.insert(width);
    Hpoints.insert(0);
    Hpoints.insert(height);

    char orientation;
    int position;

    long long int maxH,maxV,area;
    for(int i=0;i<n;i++)
    {
        cin>>orientation>>position;
        if(orientation=='H')
        {
            Hpoints.insert(position);
        }
        else
        {
            Vpoints.insert(position);
        }

        maxH=0;
        maxV=0;

        set<int>::iterator it=Vpoints.begin();
        set<int>::iterator it2=Vpoints.begin();
        it2++;

        while(it2!=Vpoints.end())
        {
            if(maxV<*it2-*it)
            {
                maxV=*it2-*it;
            }
            it2++;
            it++;

        }

        it=Hpoints.begin();
        it2=Hpoints.begin();
        it2++;

        while(it2!=Hpoints.end())
        {
            if(maxH<*it2-*it)
            {
                maxH=*it2-*it;
            }
            it2++;
            it++;

        }

        area=maxH*maxV;
        cout<<area<<"\n";

    }
}


#include <iostream>
#include <set>

using namespace std;

int main()
{
    int width,height,n;
    cin>>width>>height>>n;

    set<int> Vpoints;
    set<int> Hpoints;

    multiset<int> Vdifference;
    multiset<int> Hdifference;

    Vpoints.insert(0);
    Vpoints.insert(width);
    Hpoints.insert(0);
    Hpoints.insert(height);
    Vdifference.insert(width);
    Hdifference.insert(height);

    char orientation;
    int position;

    long long int maxH=height,maxV=width,area;
    for(int i=0;i<n;i++)
    {
        cin>>orientation>>position;
        if(orientation=='H')
        {
            set<int>::iterator it=Hpoints.upper_bound(position);
            set<int>::iterator it2=Hpoints.lower_bound(position);
            *it2--;

            Hdifference.erase(Hdifference.find(*it-*it2));
            Hdifference.insert(position-*it2);
            Hdifference.insert(*it-position);

            Hpoints.insert(position);

            it=Hdifference.end();
            it--;
            maxH=*it;
        }
        else
        {
            set<int>::iterator it=Vpoints.upper_bound(position);
            set<int>::iterator it2=Vpoints.lower_bound(position);
            it2--;

            Vdifference.erase(Vdifference.find(*it-*it2));
            Vdifference.insert(position-*it2);
            Vdifference.insert(*it-position);

            Vpoints.insert(position);

            it=Vdifference.end();
            it--;
            maxV=*it;

        }

        area=maxH*maxV;
        cout<<area<<"\n";
    }
}


#include <bits/stdc++.h>
using namespace std;

#define fast ios_base::sync_with_stdio(false),cin.tie(NULL)
#define ldb long double
#define db double
#define str string
#define int long long

#define fr first
#define se second
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define mpr make_pair

#define pi pair<int,int>
#define pdb pair<db,db>
#define pldb pair<ldb,ldb>

#define vi vector<int>
#define vdb vector<db>
#define vldb vector<ldb>
#define vpi vector< pi >

#define mi map<int,int>
#define mdb map<db,db>
#define mldb map<ldb,ldb>

#define forr(a,b) for (int i = (a); i < (b); ++i)
#define rrof(a,b) for (int i = (b)-1; i >= (a); --i)

#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)

const int md = 1e9+7;
const int MX = 2e5+5;
const int INF = 1e18;
const ldb PI = 4*atan((ldb)1);

int power(int a,int n)
{
 int res=1;
 while(n)
{
 if(n%2)
  res=(res%md*a%md)%md;
  a=(a%md*a%md)%md;
  n/=2;
}
res%=md;
return res;
}

int abst(int a)
{
 return ((a<0)?(-1*a):(a));
}

class cmp_set{
public:
	bool operator() (int a, int b){
		return a > b;
	}
};

int32_t main()
{
    fast;
    multiset< int,cmp_set > ht,wt;
    set< int > hpos,wpos;
    int w,h,n;
    cin>>w>>h>>n;
    int tmp=h;
    h=w;
    w=tmp;
    hpos.insert(0);
    hpos.insert(h);
    wpos.insert(0);
    wpos.insert(w);
    ht.insert(h);
    wt.insert(w);
    while(n--)
    {
        char ch;
        int num;
        cin>>ch>>num;
        if(ch=='H')
        {
            auto it1=wpos.lb(num);
            auto it2=it1;
            it2--;
            int a=*(it2);
            int b=*(it1);
            wt.erase(wt.find(b-a));
            wt.insert(num-a);
            wt.insert(b-num);
            wpos.insert(num);
        }
        else
        {

            auto it1=hpos.lb(num);
            auto it2=it1;
            it2--;
            int a=*(it2);
            int b=*(it1);
            ht.erase(ht.find(b-a));
            ht.insert(num-a);
            ht.insert(b-num);

            hpos.insert(num);
        }
        int res=(*(ht.begin()))*(*(wt.begin()));
        cout<<res<<"\n";
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define fast ios_base::sync_with_stdio(false),cin.tie(NULL)
#define ldb long double
#define db double
#define str string
#define int long long

#define fr first
#define se second
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define mpr make_pair

#define pi pair<int,int>
#define pdb pair<db,db>
#define pldb pair<ldb,ldb>

#define vi vector<int>
#define vdb vector<db>
#define vldb vector<ldb>
#define vpi vector< pi >

#define mi map<int,int>
#define mdb map<db,db>
#define mldb map<ldb,ldb>

#define forr(a,b) for (int i = (a); i < (b); ++i)
#define rrof(a,b) for (int i = (b)-1; i >= (a); --i)

#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)

const int md = 1e9+7;
const int MX = 2e5+5;
const int INF = 1e18;
const ldb PI = 4*atan((ldb)1);

int power(int a,int n)
{
 int res=1;
 while(n)
{
 if(n%2)
  res=(res%md*a%md)%md;
  a=(a%md*a%md)%md;
  n/=2;
}
res%=md;
return res;
}

int abst(int a)
{
 return ((a<0)?(-1*a):(a));
}

class cmp_set{
public:
	bool operator() (int a, int b){
		return a > b;
	}
};

int32_t main()
{
    fast;
    multiset< int,cmp_set > ht,wt;
    set< int > hpos,wpos;
    int w,h,n;
    cin>>w>>h>>n;
    int tmp=h;
    h=w;
    w=tmp;
    hpos.insert(0);
    hpos.insert(h);
    wpos.insert(0);
    wpos.insert(w);
    ht.insert(h);
    wt.insert(w);
    while(n--)
    {
        char ch;
        int num;
        cin>>ch>>num;
        if(ch=='H')
        {
            auto it1=wpos.lb(num);
            auto it2=it1;
            it2--;
            int a=*(it2);
            int b=*(it1);
            wt.erase((b-a));
            wt.insert(num-a);
            wt.insert(b-num);
            wpos.insert(num);
        }
        else
        {

            auto it1=hpos.lb(num);
            auto it2=it1;
            it2--;
            int a=*(it2);
            int b=*(it1);
            ht.insert(num-a);
            ht.insert(b-num);
            ht.erase(ht.find(b-a));
            hpos.insert(num);
        }
        int res=(*(ht.begin()))*(*(wt.begin()));
        cout<<res<<"\n";
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define fast ios_base::sync_with_stdio(false),cin.tie(NULL)
#define ldb long double
#define db double
#define str string
#define int long long

#define fr first
#define se second
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define mpr make_pair

#define pi pair<int,int>
#define pdb pair<db,db>
#define pldb pair<ldb,ldb>

#define vi vector<int>
#define vdb vector<db>
#define vldb vector<ldb>
#define vpi vector< pi >

#define mi map<int,int>
#define mdb map<db,db>
#define mldb map<ldb,ldb>

#define forr(a,b) for (int i = (a); i < (b); ++i)
#define rrof(a,b) for (int i = (b)-1; i >= (a); --i)

#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)

const int md = 1e9+7;
const int MX = 2e5+5;
const int INF = 1e18;
const ldb PI = 4*atan((ldb)1);

int power(int a,int n)
{
 int res=1;
 while(n)
{
 if(n%2)
  res=(res%md*a%md)%md;
  a=(a%md*a%md)%md;
  n/=2;
}
res%=md;
return res;
}

int abst(int a)
{
 return ((a<0)?(-1*a):(a));
}

class cmp_set{
public:
	bool operator() (int a, int b){
		return a > b;
	}
};

int32_t main()
{
    fast;
    multiset< int,cmp_set > ht,wt;
    set< int > hpos,wpos;
    int w,h,n;
    cin>>w>>h>>n;
    int tmp=h;
    h=w;
    w=tmp;
    hpos.insert(0);
    hpos.insert(h);
    wpos.insert(0);
    wpos.insert(w);
    ht.insert(h);
    wt.insert(w);
    while(n--)
    {
        char ch;
        int num;
        cin>>ch>>num;
        if(ch=='H')
        {
            auto it1=hpos.lb(num);
            it2=it1;
            it2--;
            int a=*(it2);
            int b=*(it1);
            ht.insert(num-a);
            ht.insert(b-num);
            ht.erase(ht.find(b-a));
            hpos.insert(num);
        }
        else
        {
            auto it1=wpos.lb(num);
            it2=it1;
            it2--;
            int a=*(it2);
            int b=*(it1);
            wt.erase((b-a));
            wt.insert(num-a);
            wt.insert(b-num);
            wpos.insert(num);
        }
        int res=(*(ht.begin()))*(*(wt.begin()));
        cout<<res<<"\n";
    }
    return 0;
}


#include<iostream>
#include<stdio.h>
#include<set>
#include<algorithm>
#include<string.h>
#include<cstring>
#define REP(i,a,b) for(int i=(a);i<=(b);++i)
typedef long long ll;
using namespace std;
set<ll>x,y;
set<ll>::iterator it;
multiset<ll>lenx,leny;
multiset<ll>::iterator it2;
int main(){
	ll w,h,n,k;
	char s;
    scanf("%lld%lld%lld",&w,&h,&n);
    s=getchar();
	lenx.insert(w);leny.insert(h);
	x.insert(0);x.insert(w);
	y.insert(0);y.insert(h);
	REP(i,1,n){
	   cin>>s;
	   //s=getchar();
	   if(s=='H'){
	   	  scanf("%lld",&k);
	   	  y.insert(k);
	   	  it=y.find(k);
	   	  it++;
	   	  ll R=*it;
	   	  it--;
	   	  it--;
		  ll L=*it;
		  leny.erase(leny.find(R-L));
		  leny.insert(R-k),leny.insert(k-L);
	   }
	   if(s=='V'){
	   	  scanf("%lld",&k);
	   	  x.insert(k);
	   	  it=x.find(k);
	   	  it++;
	   	  ll R=*it;
	   	  it--;
	   	  it--;
		  ll L=*it;
		  lenx.erase(lenx.find(R-L));
		  lenx.insert(R-k),lenx.insert(k-L);
	   }
	   it2=lenx.end();it2--;ll maxx=*it2;
	   it2=leny.end();it2--;ll maxy=*it2;
	   printf("%lld\n",maxx*maxy);
	}
	return 0;
}


#include<iostream>
#include<stdio.h>
#include<set>
#include<algorithm>
#include<string.h>
#include<cstring>
#define REP(i,a,b) for(int i=(a);i<=(b);++i)
typedef long long ll;
using namespace std;
set<int>x,y;
set<int>::iterator it;
multiset<int>lenx,leny;
multiset<int>::iterator it2;
int main(){
	int w,h,n,k;
	char s;
    scanf("%d%d%d",&w,&h,&n);
    s=getchar();
	lenx.insert(w);leny.insert(h);
	x.insert(0);x.insert(w);
	y.insert(0);y.insert(h);
	REP(i,1,n){
	   cin>>s;
	   //s=getchar();
	   if(s=='H'){
	   	  scanf("%d",&k);
	   	  y.insert(k);
	   	  it=y.find(k);
	   	  it++;
	   	  int R=*it;
	   	  it--;
	   	  it--;
		  int L=*it;
		  leny.erase(leny.find(R-L));
		  leny.insert(R-k),leny.insert(k-L);
	   }
	   if(s=='V'){
	   	  scanf("%d",&k);
	   	  x.insert(k);
	   	  it=x.find(k);
	   	  it++;
	   	  int R=*it;
	   	  it--;
	   	  it--;
		  int L=*it;
		  lenx.erase(lenx.find(R-L));
		  lenx.insert(R-k),lenx.insert(k-L);
	   }
	   it2=lenx.end(),it2--;int maxx=*it2;
	   it2=leny.end(),it2--;int maxy=*it2;
	   printf("%lld\n",maxx*maxy);
	}
	return 0;
}


#include<iostream>
#include<stdio.h>
#include<set>
#include<algorithm>
#include<string.h>
#include<cstring>
#define REP(i,a,b) for(int i=(a);i<=(b);++i)
#define ll long long;
using namespace std;
set<ll>x,y;
set<ll>::iterator it;
multiset<ll>lenx,leny;
multiset<ll>::iterator it2;
int main(){
	ll w,h,n,k;
	char s;
    scanf("%lld%lld%lld",&w,&h,&n);
    s=getchar();
	lenx.insert(w);leny.insert(h);
	x.insert(0);x.insert(w);
	y.insert(0);y.insert(h);
	REP(i,1,n){
	   cin>>s;
	   //s=getchar();
	   if(s=='H'){
	   	  scanf("%lld",&k);
	   	  y.insert(k);
	   	  it=y.find(k);
	   	  it++;
	   	  ll R=*it;
	   	  it--;
	   	  it--;
		  ll L=*it;
		  leny.erase(leny.find(R-L));
		  leny.insert(R-k),leny.insert(k-L);
	   }
	   if(s=='V'){
	   	  scanf("%lld",&k);
	   	  x.insert(k);
	   	  it=x.find(k);
	   	  it++;
	   	  ll R=*it;
	   	  it--;
	   	  it--;
		  ll L=*it;
		  lenx.erase(lenx.find(R-L));
		  lenx.insert(R-k),lenx.insert(k-L);
	   }
	   it2=lenx.end();it2--;ll maxx=*it2;
	   it2=leny.end();it2--;ll maxy=*it2;
	   printf("%lld\n",maxx*maxy);
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int x,y,d,i,a[200005],b[200005],a1,,a2,a3,a4,hight,low;
set<int> xcoordinate, ycoordinate;
multiset <long long> xlength, ylength;
set <int> ::iterator p;
char c;
int main(){
    cin>>x>>y>>a1;
    xlength.insert(x);
    ylength.insert(y);
    xcoordinate.insert(0);
    ycoordinate.insert(0);
    xcoordinate.insert(x);
    ycoordinate.insert(y);
    for (i=0; i<a1; i++){
        p=xcoordinate.lower_bound(d);
        hight=*p;
        low=*--p;
        xlength.erase(xlength.find(high-low));
        xlength.insert(d-low);
        xlength.insert(hight-d);
        xcoordinate.insert(d);
    }
    else
    {
         p=ycoordinate.lower_bound(d);
         hight=*p;
         low=*--p;
         ylength.erase(ylength.find(high-low));
         ylength.insert(d-low);
         ylength.insert(hight-d);
         ycoordinate.insert(d);
    }
    cout << (*(--xlength.end()))*(*(--ylength.end())) << endl;
}


#include<bits/stdc++.h>
using namespace std;
int x,i,d,y,a[200005], b[200005],t,a1,a2,a3,a4,high,low;
char c;
set <int> xcoordinate,ycoordinate;
multiset <long long> xlength,ylength;
set <int> ::iterator p;

int  main (){
cin>>x>>y>>a1;
xlength.insert(x);
ylength.insert(y);
xcoordinate.insert(0);
ycoordinate.insert(0);
xcoordinate.insert(x);
ycoordinate.insert(y);
 for (i=0; i<a1; i++){
    cin>>c>>d;
       if (c=='V') {
        p=xcoordinate.lower_bound(d);
        high=*p;
        low=*--p;
        xlength.erase(xlength.find(high-low));
        xlength.insert(d-low);
        xlength.insert(high-d);
        xcoordinate.insert(d);
       }
    else {
        p=ycoordinate.lower_bound(d);
        high=*p;
        low=*--p;
        ylength.erase(ylength.find(high-low));
        ylength.insert(d-low);
        ylength.insert(high-d);
        ycoordinate.insert(d);
        }
     cout<<(*(--xlength.end()))*(*(--ylength.end()))<<endl;
 }

}


#include <bits/stdc++.h>

using namespace std;

int x,y,d,i,a[200005],b[200005],a1,a2,a3,a4,hight,low;
set<int> xcoordinate, ycoordinate;
multiset <long long> xlength, ylength;
set <int> ::iterator p;
char c;
int main(){
    cin>>x>>y>>a1;
    xlength.insert(x);
    ylength.insert(y);
    xcoordinate.insert(0);
    ycoordinate.insert(0);
    xcoordinate.insert(x);
    ycoordinate.insert(y);
    for (i=0; i<a1; i++){

        if (c=='V'){
        p=xcoordinate.lower_bound(d);
        hight=*p;
        low=*--p;
        xlength.erase(xlength.find(hight-low));
        xlength.insert(d-low);
        xlength.insert(hight-d);
        xcoordinate.insert(d);
    }

    }
    else
    {
         p=ycoordinate.lower_bound(d);
         hight=*p;
         low=*--p;
         ylength.erase(ylength.find(hight-low));
         ylength.insert(d-low);
         ylength.insert(hight-d);
         ycoordinate.insert(d);
    }
}
    cout << (*(--xlength.end()))*(*(--ylength.end())) << endl;
}


#include <bits/stdc++.h>

using namespace std;

int x,y,d,i,a[200005],b[200005],a1,a2,a3,a4,hight,low;
set<int> xcoordinate, ycoordinate;
multiset <long long> xlength, ylength;
set <int> ::iterator p;
char c;
int main(){
    cin>>x>>y>>a1;
    xlength.insert(x);
    ylength.insert(y);
    xcoordinate.insert(0);
    ycoordinate.insert(0);
    xcoordinate.insert(x);
    ycoordinate.insert(y);
    for (i=0; i<a1; i++){
        p=xcoordinate.lower_bound(d);
        hight=*p;
        low=*--p;
        xlength.erase(xlength.find(high-low));
        xlength.insert(d-low);
        xlength.insert(hight-d);
        xcoordinate.insert(d);
    }
    else
    {
         p=ycoordinate.lower_bound(d);
         hight=*p;
         low=*--p;
         ylength.erase(ylength.find(high-low));
         ylength.insert(d-low);
         ylength.insert(hight-d);
         ycoordinate.insert(d);
    }
    cout << (*(--xlength.end()))*(*(--ylength.end())) << endl;
}


#include <bits/stdc++.h>

using namespace std;

int x,y,d,i,a[200005],b[200005],a1,a2,a3,a4,hight,low;
set<int> xcoordinate, ycoordinate;
multiset <long long> xlength, ylength;
set <int> ::iterator p;
char c;
int main(){
    cin>>x>>y>>a1;
    xlength.insert(x);
    ylength.insert(y);
    xcoordinate.insert(0);
    ycoordinate.insert(0);
    xcoordinate.insert(x);
    ycoordinate.insert(y);
    for (i=0; i<a1; i++){
        p=xcoordinate.lower_bound(d);
        hight=*p;
        low=*--p;
        xlength.erase(xlength.find(hight-low));
        xlength.insert(d-low);
        xlength.insert(hight-d);
        xcoordinate.insert(d);
    }
    else
    {
         p=ycoordinate.lower_bound(d);
         hight=*p;
         low=*--p;
         ylength.erase(ylength.find(hight-low));
         ylength.insert(d-low);
         ylength.insert(hight-d);
         ycoordinate.insert(d);
    }
    cout << (*(--xlength.end()))*(*(--ylength.end())) << endl;
}


#include<bits/stdc++.h>
#define ll long long
#define pii_ pair<int,int>
#define mp_ make_pair
#define pb push_back
#define fi first
#define se second
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
#define show1(a) cout<<#a<<" = "<<a<<endl
#define show2(a,b) cout<<#a<<" = "<<a<<"; "<<#b<<" = "<<b<<endl
using namespace std;
const ll INF = 1LL<<60;
const int inf = 1<<30;
const int maxn = 1e3+5;
const ll M = 1e9+7;
inline void fastio() {ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);}

ll w,h,n;
set<ll> row,col;
multiset<ll> trow,tcol;

int main()
{
    fastio();
    cin>>w>>h>>n;
    row.insert(0),row.insert(w);trow.insert(w);
    col.insert(0),col.insert(h);tcol.insert(h);
    char op; ll x,ans;
    rep(i,1,n){
        cin>>op>>x;
        if(op=='H'){
            auto it = col.lower_bound(x);
            ll R = *it;
            ll L = *(--it);
            tcol.erase(tcol.find(R-L));
            tcol.insert(R-x),tcol.insert(x-L);
            col.insert(x);
        }else{
            auto it = row.lower_bound(x);
            ll R = *it;
            ll L = *(--it);
            trow.erase(trow.find(R-L));
            trow.insert(R-x),trow.insert(x-L);
            row.insert(x);
        }
        auto t1 = trow.end(),t2 = tcol.end();
        ans = (*--t1)*(*--t2);
        cout<<ans<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define pii_ pair<int,int>
#define mp_ make_pair
#define pb push_back
#define fi first
#define se second
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
#define show1(a) cout<<#a<<" = "<<a<<endl
#define show2(a,b) cout<<#a<<" = "<<a<<"; "<<#b<<" = "<<b<<endl
using namespace std;
const ll INF = 1LL<<60;
const int inf = 1<<30;
const int maxn = 1e3+5;
const ll M = 1e9+7;
inline void fastio() {ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);}

int w,h,n;
set<int> row,col;
multiset<int> trow,tcol;

int main()
{
    fastio();
    cin>>w>>h>>n;
    row.insert(0),row.insert(w);trow.insert(w);
    col.insert(0),col.insert(h);tcol.insert(h);
    char op; int x,ans;
    rep(i,1,n){
        cin>>op>>x;
        if(op=='H'){
            auto it = col.lower_bound(x);
            int R = *it;
            int L = *(--it);
            tcol.erase(tcol.find(R-L));
            tcol.insert(R-x),tcol.insert(x-L);
            col.insert(x);
        }else{
            auto it = row.lower_bound(x);
            int R = *it;
            int L = *(--it);
            trow.erase(trow.find(R-L));
            trow.insert(R-x),trow.insert(x-L);
            row.insert(x);
        }
        auto t1 = trow.end(),t2 = tcol.end();
        ans = (*--t1)*(*--t2);
        cout<<ans<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define int long long int
int32_t main()
{

	{int n,m;
	cin>>n;
	cin>>m;
	int q;
	cin>>q;

	set<pair<int,int> > s1;
	set<pair<int,int> > s2;
	set<int> s1maxes;
	set<int> s2maxes;
	unordered_map<int,int> s1freq;
	unordered_map<int,int> s2freq;
	s1maxes.insert(n);
	s2maxes.insert(m);
	s1freq[n]++;
	s2freq[m]++;
	map<pair<char,int>,int > queries;
	int prevans=0;
	s1.insert(make_pair(0,n));
	s2.insert(make_pair(0,m));
	while(q--)
	{
		char x;
		cin>>x;
		int y;
		cin>>y;
		queries[make_pair(x,y)]++;
		if(queries[make_pair(x,y)]==1)
		{
		if(x=='V')
		{

			 auto itr=s1.lower_bound(make_pair(y,y));
			 itr--;
			s1freq[(itr->second)-(itr->first)]--;
			if(s1freq[itr->second-itr->first]==0)
				s1maxes.erase(itr->second-itr->first);
			s1.insert(make_pair(itr->first,y));
			s1.insert(make_pair(y,itr->second));

			s1freq[(y-itr->first)]++;
			s1freq[itr->second-y]++;
			s1maxes.insert(y-itr->first);
			s1maxes.insert(itr->second-y);
			s1.erase(*itr);
			auto itr1=s1maxes.end();
			auto itr2=s2maxes.end();
			prevans=(*(--itr1))*(*(--itr2));
			cout<<prevans<<endl;

		}
		else
		{
			 auto itr=s2.lower_bound(make_pair(y,y));
			 itr--;
			s2freq[(itr->second)-(itr->first)]--;
			if(s2freq[itr->second-itr->first]==0)
				s2maxes.erase(itr->second-itr->first);
			s2.insert(make_pair(itr->first,y));
			s2.insert(make_pair(y,itr->second));

			s2freq[(y-itr->first)]++;
			s2freq[itr->second-y]++;
			s2maxes.insert(y-itr->first);
			s2maxes.insert(itr->second-y);
			s2.erase(*itr);
			auto itr1=s1maxes.end();
			auto itr2=s2maxes.end();
			prevans=(*(--itr1))*(*(--itr2));
			cout<<prevans<<endl;

		}}
		else
		{
			cout<<prevans<<endl;
		}
	}}
}


#include<bits/stdc++.h>
using namespace std;
#define int long long int
int32_t main()
{

	{int n,m;
	scanf("%lld",&n);
	scanf("%lld",&m);
	int q;
	scanf("%lld",&q);

	set<pair<int,int> > s1;
	set<pair<int,int> > s2;
	set<int> s1maxes;
	set<int> s2maxes;
	unordered_map<int,int> s1freq;
	unordered_map<int,int> s2freq;
	s1maxes.insert(n);
	s2maxes.insert(m);
	s1freq[n]++;
	s2freq[m]++;
	map<pair<char,int>,int > queries;
	int prevans=0;
	s1.insert(make_pair(0,n));
	s2.insert(make_pair(0,m));
	while(q--)
	{
		char x;
		scanf(" %c",&x);
		int y;
		scanf("%lld",&y);
		queries[make_pair(x,y)]++;
		if(queries[make_pair(x,y)]==1)
		{
		if(x=='V')
		{

			 auto itr=s1.lower_bound(make_pair(y,y));
			 itr--;
			s1freq[(itr->second)-(itr->first)]--;
			if(s1freq[itr->second-itr->first]==0)
				s1maxes.erase(itr->second-itr->first);
			s1.insert(make_pair(itr->first,y));
			s1.insert(make_pair(y,itr->second));
			s1.erase(*itr);
			s1freq[(y-itr->first)]++;
			s1freq[itr->second-y]++;
			s1maxes.insert(y-itr->first);
			s1maxes.insert(itr->second-y);

			auto itr1=s1maxes.end();
			auto itr2=s2maxes.end();
			prevans=(*(--itr1))*(*(--itr2));
			printf("%lld\n",prevans);

		}
		else
		{
			 auto itr=s2.lower_bound(make_pair(y,y));
			 itr--;
			s2freq[(itr->second)-(itr->first)]--;
			if(s2freq[itr->second-itr->first]==0)
				s2maxes.erase(itr->second-itr->first);
			s2.insert(make_pair(itr->first,y));
			s2.insert(make_pair(y,itr->second));
			s2.erase(*itr);
			s2freq[(y-itr->first)]++;
			s2freq[itr->second-y]++;
			s2maxes.insert(y-itr->first);
			s2maxes.insert(itr->second-y);

			auto itr1=s1maxes.end();
			auto itr2=s2maxes.end();
			prevans=(*(--itr1))*(*(--itr2));
			printf("%lld\n",prevans);

		}}
		else
		{
			printf("%lld\n",prevans);
		}
	}}
}


#include<bits/stdc++.h>
using namespace std;
#define int long long int
int32_t main()
{

	{int n,m;
	scanf("%lld",&n);
	scanf("%lld",&m);
	int q;
	scanf("%lld",&q);

	set<pair<int,int> > s1;
	set<pair<int,int> > s2;
	set<int> s1maxes;
	set<int> s2maxes;
	unordered_map<int,int> s1freq;
	unordered_map<int,int> s2freq;
	s1maxes.insert(n);
	s2maxes.insert(m);
	s1freq[n]++;
	s2freq[m]++;
	map<pair<char,int>,int > queries;
	int prevans=0;
	s1.insert(make_pair(0,n));
	s2.insert(make_pair(0,m));
	while(q--)
	{
		char x;
		scanf(" %c",&x);
		int y;
		scanf("%lld",&y);
		queries[make_pair(x,y)]++;
		if(queries[make_pair(x,y)]==1)
		{
		if(x=='H')
		{

			 auto itr=s1.lower_bound(make_pair(y,y));
			 itr--;
			s1freq[(itr->second)-(itr->first)]--;
			if(s1freq[itr->second-itr->first]==0)
				s1maxes.erase(itr->second-itr->first);
			s1.insert(make_pair(itr->first,y));
			s1.insert(make_pair(y,itr->second));
			s1.erase(*itr);
			s1freq[(y-itr->first)]++;
			s1freq[itr->second-y]++;
			s1maxes.insert(y-itr->first);
			s1maxes.insert(itr->second-y);

			auto itr1=s1maxes.end();
			auto itr2=s2maxes.end();
			prevans=(*(--itr1))*(*(--itr2));
			printf("%lld\n",prevans);

		}
		else
		{
			 auto itr=s2.lower_bound(make_pair(y,y));
			 itr--;
			s2freq[(itr->second)-(itr->first)]--;
			if(s2freq[itr->second-itr->first]==0)
				s2maxes.erase(itr->second-itr->first);
			s2.insert(make_pair(itr->first,y));
			s2.insert(make_pair(y,itr->second));
			s2.erase(*itr);
			s2freq[(y-itr->first)]++;
			s2freq[itr->second-y]++;
			s2maxes.insert(y-itr->first);
			s2maxes.insert(itr->second-y);

			auto itr1=s1maxes.end();
			auto itr2=s2maxes.end();
			prevans=(*(--itr1))*(*(--itr2));
			printf("%lld\n",prevans);

		}}
		else
		{
			printf("%lld\n",prevans);
		}
	}}
}


#include<bits/stdc++.h>
using namespace std;
int32_t main()
{

	{int n,m;
	cin>>n;
	cin>>m;
	int q;
	cin>>q;

	set<pair<int,int> > s1;
	set<pair<int,int> > s2;
	set<int> s1maxes;
	set<int> s2maxes;
	unordered_map<int,int> s1freq;
	unordered_map<int,int> s2freq;
	s1maxes.insert(n);
	s2maxes.insert(m);
	s1freq[n]++;
	s2freq[m]++;
	map<pair<char,int>,int > queries;
	int prevans=0;
	s1.insert(make_pair(0,n));
	s2.insert(make_pair(0,m));
	while(q--)
	{
		char x;
		cin>>x;
		int y;
		cin>>y;
		queries[make_pair(x,y)]++;
		if(queries[make_pair(x,y)]==1)
		{
		if(x=='V')
		{

			 auto itr=s1.lower_bound(make_pair(y,y));
			 itr--;
			s1freq[(itr->second)-(itr->first)]--;
			if(s1freq[itr->second-itr->first]==0)
				s1maxes.erase(itr->second-itr->first);
			s1.insert(make_pair(itr->first,y));
			s1.insert(make_pair(y,itr->second));
			s1.erase(*itr);
			s1freq[(y-itr->first)]++;
			s1freq[itr->second-y]++;
			s1maxes.insert(y-itr->first);
			s1maxes.insert(itr->second-y);

			auto itr1=s1maxes.end();
			auto itr2=s2maxes.end();
			prevans=(*(--itr1))*(*(--itr2));
			cout<<prevans<<endl;

		}
		else
		{
			 auto itr=s2.lower_bound(make_pair(y,y));
			 itr--;
			s2freq[(itr->second)-(itr->first)]--;
			if(s2freq[itr->second-itr->first]==0)
				s2maxes.erase(itr->second-itr->first);
			s2.insert(make_pair(itr->first,y));
			s2.insert(make_pair(y,itr->second));
			s2.erase(*itr);
			s2freq[(y-itr->first)]++;
			s2freq[itr->second-y]++;
			s2maxes.insert(y-itr->first);
			s2maxes.insert(itr->second-y);

			auto itr1=s1maxes.end();
			auto itr2=s2maxes.end();
			prevans=(*(--itr1))*(*(--itr2));
			cout<<prevans<<endl;

		}}
		else
		{
			cout<<prevans<<endl;
		}
	}}
}


#include<bits/stdc++.h>
using namespace std;
int32_t main()
{

	{int n,m;
	cin>>n;
	cin>>m;
	int q;
	cin>>q;

	set<pair<int,int> > s1;
	set<pair<int,int> > s2;
	set<int> s1maxes;
	set<int> s2maxes;
	unordered_map<int,int> s1freq;
	unordered_map<int,int> s2freq;
	s1maxes.insert(n);
	s2maxes.insert(m);
	s1freq[n]++;
	s2freq[m]++;
	map<pair<char,int>,int > queries;
	int prevans=0;
	s1.insert(make_pair(0,n));
	s2.insert(make_pair(0,m));
	while(q--)
	{
		char x;
		cin>>x;
		int y;
		cin>>y;
		queries[make_pair(x,y)]++;
		if(queries[make_pair(x,y)]==1)
		{
		if(x=='H')
		{

			 auto itr=s1.lower_bound(make_pair(y,y));
			 itr--;
			s1freq[(itr->second)-(itr->first)]--;
			if(s1freq[itr->second-itr->first]==0)
				s1maxes.erase(itr->second-itr->first);
			s1.insert(make_pair(itr->first,y));
			s1.insert(make_pair(y,itr->second));
			s1.erase(*itr);
			s1freq[(y-itr->first)]++;
			s1freq[itr->second-y]++;
			s1maxes.insert(y-itr->first);
			s1maxes.insert(itr->second-y);

			auto itr1=s1maxes.end();
			auto itr2=s2maxes.end();
			prevans=(*(--itr1))*(*(--itr2));
			cout<<prevans<<endl;

		}
		else
		{
			 auto itr=s2.lower_bound(make_pair(y,y));
			 itr--;
			s2freq[(itr->second)-(itr->first)]--;
			if(s2freq[itr->second-itr->first]==0)
				s2maxes.erase(itr->second-itr->first);
			s2.insert(make_pair(itr->first,y));
			s2.insert(make_pair(y,itr->second));
			s2.erase(*itr);
			s2freq[(y-itr->first)]++;
			s2freq[itr->second-y]++;
			s2maxes.insert(y-itr->first);
			s2maxes.insert(itr->second-y);

			auto itr1=s1maxes.end();
			auto itr2=s2maxes.end();
			prevans=(*(--itr1))*(*(--itr2));
			cout<<prevans<<endl;

		}}
		else
		{
			cout<<prevans<<endl;
		}
	}}
}


#include<bits/stdc++.h>
using namespace std;
int32_t main()
{

	{int n,m;
	cin>>n;
	cin>>m;
	int q;
	cin>>q;

	set<pair<int,int> > s1;
	set<pair<int,int> > s2;
	set<int> s1maxes;
	set<int> s2maxes;
	unordered_map<int,int> s1freq;
	unordered_map<int,int> s2freq;
	s1maxes.insert(n);
	s2maxes.insert(m);
	s1freq[n]++;
	s2freq[m]++;
	map<pair<char,int>,int > queries;
	int prevans=0;
	s1.insert(make_pair(0,n));
	s2.insert(make_pair(0,m));
	while(q--)
	{
		char x;
		cin>>x;
		int y;
		cin>>y;
		queries[make_pair(x,y)]++;
		if(queries[make_pair(x,y)]==1)
		{
		if(x=='V')
		{

			 auto itr=s1.lower_bound(make_pair(y,y));
			 itr--;
			s1freq[(itr->second)-(itr->first)]--;
			if(s1freq[itr->second-itr->first]==0)
				s1maxes.erase(itr->second-itr->first);
			s1.insert(make_pair(itr->first,y));
			s1.insert(make_pair(y,itr->second));

			s1freq[(y-itr->first)]++;
			s1freq[itr->second-y]++;
			s1maxes.insert(y-itr->first);
			s1maxes.insert(itr->second-y);
			s1.erase(*itr);
			auto itr1=s1maxes.end();
			auto itr2=s2maxes.end();
			prevans=(*(--itr1))*(*(--itr2));
			cout<<prevans<<endl;

		}
		else
		{
			 auto itr=s2.lower_bound(make_pair(y,y));
			 itr--;
			s2freq[(itr->second)-(itr->first)]--;
			if(s2freq[itr->second-itr->first]==0)
				s2maxes.erase(itr->second-itr->first);
			s2.insert(make_pair(itr->first,y));
			s2.insert(make_pair(y,itr->second));

			s2freq[(y-itr->first)]++;
			s2freq[itr->second-y]++;
			s2maxes.insert(y-itr->first);
			s2maxes.insert(itr->second-y);
			s2.erase(*itr);
			auto itr1=s1maxes.end();
			auto itr2=s2maxes.end();
			prevans=(*(--itr1))*(*(--itr2));
			cout<<prevans<<endl;

		}}
		else
		{
			cout<<prevans<<endl;
		}
	}}
}


#include<bits/stdc++.h>
using namespace std;
#define int long long int
int32_t main()
{

	{int n,m;
	cin>>n;
	cin>>m;
	int q;
	cin>>q;

	set<pair<int,int> > s1;
	set<pair<int,int> > s2;
	set<int> s1maxes;
	set<int> s2maxes;
	unordered_map<int,int> s1freq;
	unordered_map<int,int> s2freq;
	s1maxes.insert(n);
	s2maxes.insert(m);
	s1freq[n]++;
	s2freq[m]++;
	map<pair<char,int>,int > queries;
	int prevans=0;
	s1.insert(make_pair(0,n));
	s2.insert(make_pair(0,m));
	while(q--)
	{
		char x;
		cin>>x;
		int y;
		cin>>y;
		queries[make_pair(x,y)]++;
		if(queries[make_pair(x,y)]==1)
		{
		if(x=='V')
		{

			 auto itr=s1.lower_bound(make_pair(y,y));
			 itr--;
			s1freq[(itr->second)-(itr->first)]--;
			if(s1freq[itr->second-itr->first]==0)
				s1maxes.erase(itr->second-itr->first);
			s1.insert(make_pair(itr->first,y));
			s1.insert(make_pair(y,itr->second));
			s1.erase(*itr);
			s1freq[(y-itr->first)]++;
			s1freq[itr->second-y]++;
			s1maxes.insert(y-itr->first);
			s1maxes.insert(itr->second-y);

			auto itr1=s1maxes.end();
			auto itr2=s2maxes.end();
			prevans=(*(--itr1))*(*(--itr2));
			cout<<prevans<<endl;

		}
		else
		{
			 auto itr=s2.lower_bound(make_pair(y,y));
			 itr--;
			s2freq[(itr->second)-(itr->first)]--;
			if(s2freq[itr->second-itr->first]==0)
				s2maxes.erase(itr->second-itr->first);
			s2.insert(make_pair(itr->first,y));
			s2.insert(make_pair(y,itr->second));
			s2.erase(*itr);
			s2freq[(y-itr->first)]++;
			s2freq[itr->second-y]++;
			s2maxes.insert(y-itr->first);
			s2maxes.insert(itr->second-y);

			auto itr1=s1maxes.end();
			auto itr2=s2maxes.end();
			prevans=(*(--itr1))*(*(--itr2));
			cout<<prevans<<endl;

		}}
		else
		{
			cout<<prevans<<endl;
		}
	}}
}


#include <iostream>
#include <fstream>
#include <cmath>
#include <cstring>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <map>
#include <bitset>
#include <set>
//#include <cstdint>
#include <algorithm>

using namespace std;

enum ctype{
    none  =0x00,
    x_axis=0x01,
    y_axis=0x02
};

class mempool{
private:
    void *begin=NULL;
    unsigned long long int index=0;
public:
    mempool(unsigned long long int len){
        begin=malloc(len);
    }
    void* my_malloc(unsigned long long int len){
        return (void*)(((unsigned long long int)begin)+(index+=len));
    }
}Mem(80000000);

class seg{
private:
    unsigned long long int h;
    unsigned char cut=none;
    unsigned long long int wh=0;
    unsigned long long  int maxlen;
    bool c=false;
    seg *l=NULL,*r=NULL;
public:
    seg(){}
    seg(unsigned long long int ah):h(ah){maxlen=ah;}
    void make(unsigned long long int ah){h=ah;cut=none;wh=0;c=false;l=NULL;r=NULL;maxlen=h;}
    inline unsigned long long int maxLen(){
        if(c){
            if(cut)maxlen=max(l->maxLen(),r->maxLen());
            else   maxlen=h;
            c=false;
        }
        return maxlen;
    }
    void cut_h(unsigned long long  int _wh){
        if(_wh==0||_wh==h)return;
        switch(cut){
            case none:
                c=true;
                cut=x_axis;
                wh=_wh;
                //l=new sqr(w,wh);
                //r=new sqr(w,h-wh);
                l=(seg*)Mem.my_malloc(sizeof(seg));
                l->make(wh);
                r=(seg*)Mem.my_malloc(sizeof(seg));
                r->make(h-wh);
                break;
            case x_axis:
                if(wh==_wh)break;
                else ((_wh>wh)?(r):(l))->cut_h((_wh>wh)?(_wh-wh):_wh),c=true;
                break;
            case y_axis:
                c=true;
                l->cut_h(_wh);
                r->cut_h(_wh);
                break;
            default:
                //cnm
                break;
        }
    }
};

int main(int argc , char **argv){

//    cerr<<Mem.malloc(4)<<" "<<Mem.malloc(4)<<endl;

    unsigned long long int n,w,h;
    //cin>>w>>h>>n;
    scanf("%llu%llu%llu",&w,&h,&n);

    seg x(w),y(h);

    char opt;   unsigned long long int p;

    while(n--){
        //cin>>opt>>p;
        scanf(" %c%llu",&opt,&p);
        if(opt=='V')x.cut_h(p);
        else        y.cut_h(p);
        //cout<<a.maxArea()<<endl;
        printf("%llu\n",x.maxLen()*y.maxLen());
    }

    return 0;

}


#include <iostream>
#include <fstream>
#include <cmath>
#include <cstring>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <map>
#include <bitset>
#include <set>
//#include <cstdint>
#include <algorithm>

using namespace std;

enum ctype{
    none  =0x00,
    x_axis=0x01,
    y_axis=0x02
};

class mempool{
private:
    void *begin=NULL;
    unsigned long long int index=0;
public:
    mempool(unsigned long long int len){
        begin=malloc(len);
    }
    void* my_malloc(unsigned long long int len){
        return (void*)(((unsigned long long int)begin)+(index+=len));
    }
}Mem(80000000);

class sqr{
private:
    unsigned int w,h;
    unsigned char cut=none,wh=0;
    unsigned int maxarea;
    bool c=false;
    sqr *l=NULL,*r=NULL;
public:
    sqr(){}
    sqr(unsigned int aw,unsigned int ah):w(aw),h(ah){maxarea=aw*ah;}
    void make(unsigned int aw,unsigned int ah){w=aw;h=ah;cut=none;wh=0;c=false;l=NULL;r=NULL;maxarea=aw*ah;}
    /*~sqr(){
        if(l!=NULL){
            l->~sqr();
            delete l;
        }
        if(r!=NULL){
            r->~sqr();
            delete r;
        }
    }*/
    inline unsigned int maxArea(){
        if(c){
            if(cut)maxarea=max(l->maxArea(),r->maxArea());
            else   maxarea=w*h;
            c=false;
        }
        return maxarea;
    }
    void cut_h(unsigned int _wh){
        if(_wh==0||_wh==h)return;
        switch(cut){
            case none:
                c=true;
                cut=x_axis;
                wh=_wh;
                //l=new sqr(w,wh);
                //r=new sqr(w,h-wh);
                l=(sqr*)Mem.my_malloc(sizeof(sqr));
                l->make(w,wh);
                r=(sqr*)Mem.my_malloc(sizeof(sqr));
                r->make(w,h-wh);
                break;
            case x_axis:
                if(wh==_wh)break;
                else ((_wh>wh)?(r):(l))->cut_h((_wh>wh)?(_wh-wh):_wh),c=true;
                break;
            case y_axis:
                c=true;
                l->cut_h(_wh);
                r->cut_h(_wh);
                break;
            default:
                //cnm
                break;
        }
    }
    void cut_v(unsigned int _wh){
        if(_wh==0||_wh==w)return;
        switch(cut){
            case none:
                c=true;
                cut=y_axis;
                wh=_wh;
                //l=new sqr(wh,h);
                //r=new sqr(w-wh,h);
                l=(sqr*)Mem.my_malloc(sizeof(sqr));
                l->make(wh,h);
                r=(sqr*)Mem.my_malloc(sizeof(sqr));
                r->make(w-wh,h);
                break;
            case x_axis:
                c=true;
                l->cut_v(_wh);
                r->cut_v(_wh);
                break;
            case y_axis:
                if(wh==_wh)break;
                else ((_wh>wh)?(r):(l))->cut_v((_wh>wh)?(_wh-wh):_wh),c=true;
                break;
            default:
                //cnm
                break;
        }
    }
};

int main(int argc , char **argv){

//    cerr<<Mem.malloc(4)<<" "<<Mem.malloc(4)<<endl;

    unsigned int n,w,h;
    cin>>w>>h>>n;
    //scanf("%u%u%u",&w,&h,&n);

    sqr a(w,h);

    char opt;   unsigned int p;

    while(n--){
        cin>>opt>>p;
        //scanf(" %c%u",&opt,&p);
        if(opt=='H')a.cut_h(p);
        else        a.cut_v(p);
        cout<<a.maxArea()<<endl;
        //printf("%u\n",a.maxArea());
    }

    return 0;

}


#include <iostream>
#include <fstream>
#include <cmath>
#include <cstring>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <map>
#include <bitset>
#include <set>
//#include <cstdint>
#include <algorithm>

using namespace std;

enum ctype{
    none  =0x00,
    x_axis=0x01,
    y_axis=0x02
};

class mempool{
private:
    void *begin=NULL;
    unsigned long long int index=0;
public:
    mempool(unsigned long long int len){
        begin=malloc(len);
    }
    void* my_malloc(unsigned long long int len){
        return (void*)(((unsigned long long int)begin)+(index+=len));
    }
}Mem(80000000);

class sqr{
private:
    unsigned int w,h;
    unsigned char cut=none;
    unsigned int wh=0;
    unsigned int maxarea;
    bool c=false;
    sqr *l=NULL,*r=NULL;
public:
    sqr(){}
    sqr(unsigned int aw,unsigned int ah):w(aw),h(ah){maxarea=aw*ah;}
    void make(unsigned int aw,unsigned int ah){w=aw;h=ah;cut=none;wh=0;c=false;l=NULL;r=NULL;maxarea=aw*ah;}
    /*~sqr(){
        if(l!=NULL){
            l->~sqr();
            delete l;
        }
        if(r!=NULL){
            r->~sqr();
            delete r;
        }
    }*/
    inline unsigned int maxArea(){
        if(c){
            if(cut)maxarea=max(l->maxArea(),r->maxArea());
            else   maxarea=w*h;
            c=false;
        }
        return maxarea;
    }
    void cut_h(unsigned int _wh){
        if(_wh==0||_wh==h)return;
        switch(cut){
            case none:
                c=true;
                cut=x_axis;
                wh=_wh;
                //l=new sqr(w,wh);
                //r=new sqr(w,h-wh);
                l=(sqr*)Mem.my_malloc(sizeof(sqr));
                l->make(w,wh);
                r=(sqr*)Mem.my_malloc(sizeof(sqr));
                r->make(w,h-wh);
                break;
            case x_axis:
                if(wh==_wh)break;
                else ((_wh>wh)?(r):(l))->cut_h((_wh>wh)?(_wh-wh):_wh),c=true;
                break;
            case y_axis:
                c=true;
                l->cut_h(_wh);
                r->cut_h(_wh);
                break;
            default:
                //cnm
                break;
        }
    }
    void cut_v(unsigned int _wh){
        if(_wh==0||_wh==w)return;
        switch(cut){
            case none:
                c=true;
                cut=y_axis;
                wh=_wh;
                //l=new sqr(wh,h);
                //r=new sqr(w-wh,h);
                l=(sqr*)Mem.my_malloc(sizeof(sqr));
                l->make(wh,h);
                r=(sqr*)Mem.my_malloc(sizeof(sqr));
                r->make(w-wh,h);
                break;
            case x_axis:
                c=true;
                l->cut_v(_wh);
                r->cut_v(_wh);
                break;
            case y_axis:
                if(wh==_wh)break;
                else ((_wh>wh)?(r):(l))->cut_v((_wh>wh)?(_wh-wh):_wh),c=true;
                break;
            default:
                //cnm
                break;
        }
    }
};

int main(int argc , char **argv){

//    cerr<<Mem.malloc(4)<<" "<<Mem.malloc(4)<<endl;

    unsigned int n,w,h;
    //cin>>w>>h>>n;
    scanf("%u%u%u",&w,&h,&n);

    sqr a(w,h);

    char opt;   unsigned int p;

    while(n--){
        //cin>>opt>>p;
        scanf(" %c%u",&opt,&p);
        if(opt=='H')a.cut_h(p);
        else        a.cut_v(p);
        cout<<a.maxArea()<<endl;
        printf("%u\n",a.maxArea());
    }

    return 0;

}


#include <iostream>
#include <fstream>
#include <cmath>
#include <cstring>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <map>
#include <bitset>
#include <set>
//#include <cstdint>
#include <algorithm>

using namespace std;

enum ctype{
    none  =0x00,
    x_axis=0x01,
    y_axis=0x02
};

class mempool{
private:
    void *begin=NULL;
    unsigned long long int index=0;
public:
    mempool(unsigned long long int len){
        begin=malloc(len);
    }
    void* my_malloc(unsigned long long int len){
        return (void*)(((unsigned long long int)begin)+(index+=len));
    }
}Mem(240000000);

class sqr{
private:
    unsigned int w,h;
    unsigned char cut=none;
    unsigned int wh=0;
    unsigned int maxarea;
    bool c=false;
    sqr *l=NULL,*r=NULL;
public:
    sqr(){}
    sqr(unsigned int aw,unsigned int ah):w(aw),h(ah){maxarea=aw*ah;}
    void make(unsigned int aw,unsigned int ah){w=aw;h=ah;cut=none;wh=0;c=false;l=NULL;r=NULL;maxarea=aw*ah;}
    /*~sqr(){
        if(l!=NULL){
            l->~sqr();
            delete l;
        }
        if(r!=NULL){
            r->~sqr();
            delete r;
        }
    }*/
    inline unsigned int maxArea(){
        if(c){
            if(cut)maxarea=max(l->maxArea(),r->maxArea());
            else   maxarea=w*h;
            c=false;
        }
        return maxarea;
    }
    void cut_h(unsigned int _wh){
        if(_wh==0||_wh==h)return;
        switch(cut){
            case none:
                c=true;
                cut=x_axis;
                wh=_wh;
                //l=new sqr(w,wh);
                //r=new sqr(w,h-wh);
                l=(sqr*)Mem.my_malloc(sizeof(sqr));
                l->make(w,wh);
                r=(sqr*)Mem.my_malloc(sizeof(sqr));
                r->make(w,h-wh);
                break;
            case x_axis:
                if(wh==_wh)break;
                else ((_wh>wh)?(r):(l))->cut_h((_wh>wh)?(_wh-wh):_wh),c=true;
                break;
            case y_axis:
                c=true;
                l->cut_h(_wh);
                r->cut_h(_wh);
                break;
            default:
                //cnm
                break;
        }
    }
    void cut_v(unsigned int _wh){
        if(_wh==0||_wh==w)return;
        switch(cut){
            case none:
                c=true;
                cut=y_axis;
                wh=_wh;
                //l=new sqr(wh,h);
                //r=new sqr(w-wh,h);
                l=(sqr*)Mem.my_malloc(sizeof(sqr));
                l->make(wh,h);
                r=(sqr*)Mem.my_malloc(sizeof(sqr));
                r->make(w-wh,h);
                break;
            case x_axis:
                c=true;
                l->cut_v(_wh);
                r->cut_v(_wh);
                break;
            case y_axis:
                if(wh==_wh)break;
                else ((_wh>wh)?(r):(l))->cut_v((_wh>wh)?(_wh-wh):_wh),c=true;
                break;
            default:
                //cnm
                break;
        }
    }
};

int main(int argc , char **argv){

//    cerr<<Mem.malloc(4)<<" "<<Mem.malloc(4)<<endl;

    unsigned int n,w,h;
    //cin>>w>>h>>n;
    scanf("%u%u%u",&w,&h,&n);

    sqr a(w,h);

    char opt;   unsigned int p;

    while(n--){
        //cin>>opt>>p;
        scanf(" %c%u",&opt,&p);
        if(opt=='H')a.cut_h(p);
        else        a.cut_v(p);
        //cout<<a.maxArea()<<endl;
        printf("%u\n",a.maxArea());
    }

    return 0;

}


#include <iostream>
#include <fstream>
#include <cmath>
#include <cstring>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <map>
#include <bitset>
#include <set>
//#include <cstdint>
#include <algorithm>

using namespace std;

enum ctype{
    none  =0x00,
    x_axis=0x01,
    y_axis=0x02
};

class mempool{
private:
    void *begin=NULL;
    unsigned long long int index=0;
public:
    mempool(unsigned long long int len){
        begin=malloc(len);
    }
    void* my_malloc(unsigned long long int len){
        len+=4;
        memset((void*)((unsigned long long int)begin+index),0,len);
        return (void*)(((unsigned long long int)begin)+(index+=len));
    }
}Mem(160000000);

class sqr{
private:
    unsigned int w,h;
    unsigned char cut=none,wh=0;
    unsigned int maxarea;
    bool c=true;
    sqr *l=NULL,*r=NULL;
public:
    sqr(){}
    sqr(unsigned int aw,unsigned int ah):w(aw),h(ah){}
    void make(unsigned int aw,unsigned int ah){w=aw;h=ah;cut=none;wh=0;c=true;l=NULL;r=NULL;}
    /*~sqr(){
        if(l!=NULL){
            l->~sqr();
            delete l;
        }
        if(r!=NULL){
            r->~sqr();
            delete r;
        }
    }*/
    inline unsigned int maxArea(){
        if(c){
            if(cut)maxarea=max(l->maxArea(),r->maxArea());
            else   maxarea=w*h;
            c=false;
        }
        return maxarea;
    }
    void cut_h(unsigned int _wh){
        if(_wh==0||_wh==h)return;
        switch(cut){
            case none:
                c=true;
                cut=x_axis;
                wh=_wh;
                //l=new sqr(w,wh);
                //r=new sqr(w,h-wh);
                l=(sqr*)Mem.my_malloc(sizeof(sqr));
                l->make(w,wh);
                r=(sqr*)Mem.my_malloc(sizeof(sqr));
                r->make(w,h-wh);
                break;
            case x_axis:
                if(wh==_wh)break;
                else ((_wh>wh)?(r):(l))->cut_h((_wh>wh)?(_wh-wh):_wh),c=true;
                break;
            case y_axis:
                c=true;
                l->cut_h(_wh);
                r->cut_h(_wh);
                break;
            default:
                //cnm
                break;
        }
    }
    void cut_v(unsigned int _wh){
        if(_wh==0||_wh==w)return;
        switch(cut){
            case none:
                c=true;
                cut=y_axis;
                wh=_wh;
                //l=new sqr(wh,h);
                //r=new sqr(w-wh,h);
                l=(sqr*)Mem.my_malloc(sizeof(sqr));
                l->make(wh,h);
                r=(sqr*)Mem.my_malloc(sizeof(sqr));
                r->make(w-wh,h);
                break;
            case x_axis:
                c=true;
                l->cut_v(_wh);
                r->cut_v(_wh);
                break;
            case y_axis:
                if(wh==_wh)break;
                else ((_wh>wh)?(r):(l))->cut_v((_wh>wh)?(_wh-wh):_wh),c=true;
                break;
            default:
                //cnm
                break;
        }
    }
};

int main(int argc , char **argv){

//    cerr<<Mem.malloc(4)<<" "<<Mem.malloc(4)<<endl;

    unsigned int n,w,h; //cin>>w>>h>>n;
    scanf("%u%u%u",&w,&h,&n);

    sqr a(w,h);

    char opt;   unsigned int p;

    while(n--){
        //cin>>opt>>p;
        scanf(" %c%u",&opt,&p);
        if(opt=='H')a.cut_h(p);
        else        a.cut_v(p);
        //cout<<a.maxArea()<<endl;
        printf("%u\n",a.maxArea());
    }

    return 0;

}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
set<ll>s1,s2;
multiset<ll>v1,v2;
char s[10];
ll x;
int main()
{
	ll w,h,n;
	cin>>w>>h>>n;
	s1.insert(0);
	s1.insert(w);
	s2.insert(0);
	s2.insert(h);
	v1.insert(w);
	v2.insert(h);
	for(int i=1;i<=n;i++)
	{
		scanf("%s%I64d",s,&x);
		if(s[0]=='V')
		{
		   s1.insert(x);
		   set<ll>::iterator now,pre,nxt;
		   now=s1.find(x);
		   pre=now;
		   nxt=now;
		   pre--;nxt++;
		   ll wid=(*nxt)-(*pre);
		   multiset<ll>::iterator temp=v1.find(wid);
		   v1.erase(temp);
		   ll aa=(*nxt)-(*now);
		   ll bb=(*now)-(*pre);
		   v1.insert(aa);
		   v1.insert(bb);
		//   cout<<i<<": "<<aa<<" "<<bb<<endl;
		}
		else
		{
		   s2.insert(x);
		   set<ll>::iterator now,pre,nxt;
		   now=s2.find(x);
		   pre=now;
		   nxt=now;
		   pre--;nxt++;
		   ll wid=(*nxt)-(*pre);
		   multiset<ll>::iterator temp=v2.find(wid);
		   v2.erase(temp);
		   ll aa=(*nxt)-(*now);
		   ll bb=(*now)-(*pre);
		   v2.insert(aa);
		   v2.insert(bb);
		//   cout<<i<<": "<<aa<<" "<<bb<<endl;
		}
		multiset<ll>::iterator it;
		it=v1.end();it--;
		ll a=*it;
		it=v2.end();it--;
		ll b=*it;
		printf("%I64d\n",a*b);
	}
	return 0;
}


#include <iostream>
#include <fstream>
#include <cmath>
#include <cstring>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <map>
#include <bitset>
#include <set>
//#include <cstdint>
#include <algorithm>

using namespace std;

enum ctype{
    none  =0x00,
    x_axis=0x01,
    y_axis=0x02
};

class mempool{
private:
    void *begin=NULL;
    unsigned long long int index=0;
public:
    mempool(unsigned long long int len){
        begin=malloc(len);
    }
    void* my_malloc(unsigned long long int len){
        return (void*)(((unsigned long long int)begin)+(index+=len));
    }
}Mem(160000000);

class seg{
private:
    unsigned long long int h;
    unsigned char cut=none;
    unsigned long long int wh=0;
    unsigned long long int maxlen;
    bool c=false;
    seg *l=NULL,*r=NULL;
public:
    seg(){}
    seg(unsigned long long int ah):h(ah){maxlen=ah;}
    void make(unsigned long long int ah){h=ah;cut=none;wh=0;c=false;l=NULL;r=NULL;maxlen=h;}
    inline unsigned long long int maxLen(){
        if(c){
            if(cut)maxlen=max(l->maxLen(),r->maxLen());
            else   maxlen=h;
            c=false;
        }
        return maxlen;
    }
    void cut_h(unsigned long long int _wh){
        if(_wh==0||_wh==h)return;
        switch(cut){
            case none:
                c=true;
                cut=x_axis;
                wh=_wh;
                //l=new sqr(w,wh);
                //r=new sqr(w,h-wh);
                l=(seg*)Mem.my_malloc(sizeof(seg));
                l->make(wh);
                r=(seg*)Mem.my_malloc(sizeof(seg));
                r->make(h-wh);
                break;
            case x_axis:
                if(wh==_wh)break;
                else ((_wh>wh)?(r):(l))->cut_h((_wh>wh)?(_wh-wh):_wh);
                c=true;
                break;
            /*case恁娘了个腿
            case y_axis:
                c=true;
                l->cut_h(_wh);
                r->cut_h(_wh);
                break;
             */
            default:
                //cnm
                break;
        }
    }
};

int main(int argc , char **argv){

//    cerr<<Mem.malloc(4)<<" "<<Mem.malloc(4)<<endl;

    unsigned long long int n,w,h;
    //cin>>w>>h>>n;
    scanf("%llu%llu%llu",&w,&h,&n);

    seg x(w),y(h);

    char opt;   unsigned long long int p;

    while(n--){
        //cin>>opt>>p;
        scanf(" %c%llu",&opt,&p);
        if(opt=='V')x.cut_h(p);
        else        y.cut_h(p);
        //cout<<a.maxArea()<<endl;
        printf("%llu\n",x.maxLen()*y.maxLen());
    }

    return 0;

}


#include <bits/stdc++.h>

using namespace std;

using ll = long long;

ll subsolve(vector<ll>& v, ll sum) {
    ll val = 0;
    unordered_map<ll, ll> S;
    S[0] = 1;
    ll ret = 0;
    for(auto &x: v) {
        val += x;
        if(S.count(val - sum))
            ret += S[val - sum];
        S[val] += 1;
    }
    return ret;
}

ll solve(vector<ll>& v, int k) {
    if(k == 1)
        return subsolve(v, 1);
    if(k == -1)
        return subsolve(v, 1) + subsolve(v, -1);

    ll ret = 0;
    for(ll x = 1; llabs(x) <= 1e14 + 1e7; x *= k)
        ret += subsolve(v, x);

    return ret;
}

int main()
{
    cin.tie(0);
    cin.sync_with_stdio(0);
    int n, k;
    cin >> n >> k;
    vector<ll> v(n);
    for(auto &it: v)
        cin >> it;

    cout << solve(v, k) << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define ll long long

#define back(m) (((m).rbegin())->first)

void cut(map<int, int>& M, map<int, int>& mx, int x) {
    auto it = M.upper_bound(x);
    --it;

    mx[it->second] -= 1;
    if(mx[it->second] == 0)
        mx.erase(it->second);

    int lenA = x - it->first;
    int lenB = it->second - lenA;
    it->second = lenA;
    M[x] = lenB;

    mx[lenA] += 1;
    mx[lenB] += 1;
}

int main()
{
    int w, h, n;
    cin >> w >> h >> n;
    map<int, int> W, H, Wmx, Hmx;
    W[0] = w;
    H[0] = h;
    Wmx[w] = 1;
    Hmx[h] = 1;
    while(n--) {
        char c;
        int x;
        cin >> c >> x;
        if(c == 'H')
            cut(H, Hmx, x);
        else
            cut(W, Wmx, x);
        cout << (ll)back(Hmx) * back(Wmx) << endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define ll long long

#define back(m) (((m).rbegin())->first)

void cut(map<int, int>& M, map<int, int>& mx, int x) {
    auto it = M.upper_bound(x);
    --it;

    mx[it->second] -= 1;
    if(mx[it->second] == 0)
        mx.erase(it->second);

    int lenA = x - it->first;
    int lenB = it->second - lenA;
    it->second = lenA;
    M[x] = lenB;

    mx[lenA] += 1;
    mx[lenB] += 1;
}

int main()
{
    int w, h, n;
    cin >> w >> h >> n;
    map<int, int> W, H, Wmx, Hmx;
    W[0] = w;
    H[0] = h;
    Wmx[w] = 1;
    Hmx[h] = 1;
    while(n--) {
        char c;
        int x;
        cin >> c >> x;
        if(c == 'H')
            cut(H, Hmx, x);
        else
            cut(W, Wmx, x);
        cout << back(Hmx) * back(Wmx) << endl;
    }
    return 0;
}


#include <iostream>
#include <set>
#include <cstdint>

int main(){
    int64_t w, h, n;
    std::cin >> w >> h >> n;

    std::set<int64_t> H_cuts;
    std::set<int64_t> V_cuts;
    H_cuts.insert(0);
    H_cuts.insert(h);
    V_cuts.insert(0);
    V_cuts.insert(w);

    int64_t last_big_H = h;
    int64_t last_big_V = w;

    std::string direction;
    int64_t distance;
    int64_t diff;
    int64_t big_H, H_lower = 0, H_upper = h;
    int64_t big_V, V_lower = 0, V_upper = w;
    for(int64_t i = 0; i < n; ++i){
        std::cin >> direction >> distance;

        if(direction == "H"){
            H_cuts.insert(distance);

            if(distance > H_lower && distance < H_upper){
                auto first = H_cuts.begin();
                auto after = H_cuts.begin();
                ++after;
                big_H = 0;
                for(; after != H_cuts.end(); ++first, ++after){
                    diff = *after - *first;
                    if(diff > big_H){
                        big_H = diff;
                        H_lower = *first;
                        H_upper = *after;
                        if(big_H == last_big_H){
                            break;
                        }
                    }
                }
                last_big_H = big_H;
            }

        }
        else{
            V_cuts.insert(distance);

            if(distance > V_lower && distance < V_upper){
                auto first = V_cuts.begin();
                auto after = V_cuts.begin();
                ++after;
                big_V = 0;
                for(; after != V_cuts.end(); ++first, ++after){
                    diff = *after - *first;
                    if(diff > big_V){
                        big_V = diff;
                        V_lower = *first;
                        V_upper = *after;
                        if(big_V == last_big_V){
                            break;
                        }
                    }
                }
                last_big_V = big_V;
            }
        }
        std::cout << (last_big_H*last_big_V) << std::endl;
    }
    return 0;
}


#include <iostream>
#include <set>
#include <cstdint>
#include <vector>
#include <algorithm>

int main(){
    int64_t w, h, n;
    std::cin >> w >> h >> n;

    std::set<int64_t> H_cuts;
    std::set<int64_t> V_cuts;
    H_cuts.insert(0);
    H_cuts.insert(h);
    V_cuts.insert(0);
    V_cuts.insert(w);

    int64_t last_big_H = h;
    int64_t last_big_V = w;

    std::vector<int64_t> H_heap {h};
    std::vector<int64_t> V_heap {w};

    std::string direction;
    int64_t distance;
    int64_t diff;
    int64_t big_H, H_lower = 0, H_upper = h;
    int64_t big_V, V_lower = 0, V_upper = w;
    for(int64_t i = 0; i < n; ++i){
        std::cin >> direction >> distance;

        if(direction == "H"){

            auto it = H_cuts.lower_bound(distance);
            int64_t lower = *it;
            int64_t upper = *(++it);

            H_heap.erase(find(H_heap.begin(), H_heap.end(), upper-lower));

            H_heap.push_back(distance-lower);
            H_heap.push_back(upper-distance);
            push_pop(H_heap.begin(), H_heap.end());
            last_big_H = H_heap.back;
            push_heap(H_heap.begin(), H_heap.end());

            H_cuts.insert(distance);

            /*if(distance > H_lower && distance < H_upper){
            }*/

            /*if(distance > H_lower && distance < H_upper){
                auto first = H_cuts.begin();
                auto after = H_cuts.begin();
                ++after;
                big_H = 0;
                for(; after != H_cuts.end(); ++first, ++after){
                    diff = *after - *first;
                    if(diff > big_H){
                        big_H = diff;
                        H_lower = *first;
                        H_upper = *after;
                        if(big_H == last_big_H){
                            break;
                        }
                    }
                }
                last_big_H = big_H;
            }*/

        }
        else{
            auto it = H_cuts.lower_bound(distance);
            int64_t lower = *it;
            int64_t upper = *(++it);

            H_heap.erase(find(H_heap.begin(), H_heap.end(), upper-lower));

            H_heap.push_back(distance-lower);
            H_heap.push_back(upper-distance);
            push_pop(H_heap.begin(), H_heap.end());
            last_big_H = H_heap.back;
            push_heap(H_heap.begin(), H_heap.end());

            H_cuts.insert(distance);
/*
            V_cuts.insert(distance);

            if(distance > V_lower && distance < V_upper){
                auto first = V_cuts.begin();
                auto after = V_cuts.begin();
                ++after;
                big_V = 0;
                for(; after != V_cuts.end(); ++first, ++after){
                    diff = *after - *first;
                    if(diff > big_V){
                        big_V = diff;
                        V_lower = *first;
                        V_upper = *after;
                        if(big_V == last_big_V){
                            break;
                        }
                    }
                }
                last_big_V = big_V;
            }
*/
        }
        std::cout << (last_big_H*last_big_V) << std::endl;
    }
    return 0;
}


#include <iostream>
#include <set>
#include <cstdint>
#include <vector>
#include <algorithm>

int main(){
    int64_t w, h, n;
    std::cin >> w >> h >> n;

    std::multiset<int64_t> H_cuts;
    std::multiset<int64_t> V_cuts;
    H_cuts.insert(0);
    H_cuts.insert(h);
    V_cuts.insert(0);
    V_cuts.insert(w);

    int64_t last_big_H = h;
    int64_t last_big_V = w;

    std::multiset<int64_t> H_width;
    std::multiset<int64_t> V_width;
    H_width.insert(h);
    V_width.insert(w);

    std::string direction;
    int64_t distance;
    for(int64_t i = 0; i < n; ++i){
        std::cin >> direction >> distance;

        if(direction == "H"){
            auto it = H_cuts.lower_bound(distance);
            int64_t upper = *it;
            int64_t lower = *(--it);
            H_width.erase(H_width.find(upper-lower));

            H_width.insert(upper-distance);
            H_width.insert(distance-lower);
            last_big_H = *H_width.rbegin();
            H_cuts.insert(distance);
        }
        else{
            auto it = V_cuts.lower_bound(distance);
            int64_t upper = *it;
            int64_t lower = *(--it);
            V_width.erase(V_width.find(upper-lower));

            V_width.insert(upper-distance);
            V_width.insert(distance-lower);
            last_big_V = *V_width.rbegin();
            V_cuts.insert(distance);
        }
        std::cout << (last_big_H*last_big_V) << std::endl;
    }
    return 0;
}


#include <iostream>
#include <set>
#include <cstdint>
#include <vector>
#include <algorithm>

int main(){
    int64_t w, h, n;
    std::cin >> w >> h >> n;

    std::set<int64_t> H_cuts;
    std::set<int64_t> V_cuts;
    H_cuts.insert(0);
    H_cuts.insert(h);
    V_cuts.insert(0);
    V_cuts.insert(w);

    int64_t last_big_H = h;
    int64_t last_big_V = w;

    std::vector<int64_t> H_heap {h};
    std::vector<int64_t> V_heap {w};

    std::string direction;
    int64_t distance;
    int64_t diff;
    int64_t big_H, H_lower = 0, H_upper = h;
    int64_t big_V, V_lower = 0, V_upper = w;
    for(int64_t i = 0; i < n; ++i){
        std::cin >> direction >> distance;

        if(direction == "H"){

            auto it = H_cuts.lower_bound(distance);
            int64_t upper = *it;
            int64_t lower = *(--it);

            H_heap.erase(find(H_heap.begin(), H_heap.end(), upper-lower));

            H_heap.push_back(distance-lower);
            H_heap.push_back(upper-distance);
            pop_heap(H_heap.begin(), H_heap.end());
            last_big_H = H_heap.back();
            push_heap(H_heap.begin(), H_heap.end());

            H_cuts.insert(distance);

            /*if(distance > H_lower && distance < H_upper){
            }*/

            /*if(distance > H_lower && distance < H_upper){
                auto first = H_cuts.begin();
                auto after = H_cuts.begin();
                ++after;
                big_H = 0;
                for(; after != H_cuts.end(); ++first, ++after){
                    diff = *after - *first;
                    if(diff > big_H){
                        big_H = diff;
                        H_lower = *first;
                        H_upper = *after;
                        if(big_H == last_big_H){
                            break;
                        }
                    }
                }
                last_big_H = big_H;
            }*/

        }
        else{
            auto it = V_cuts.lower_bound(distance);
            int64_t upper = *it;
            int64_t lower = *(--it);

            V_heap.erase(find(V_heap.begin(), V_heap.end(), upper-lower));

            V_heap.push_back(distance-lower);
            V_heap.push_back(upper-distance);
            make_heap(V_heap.begin(), V_heap.end());
            pop_heap(V_heap.begin(), V_heap.end());
            last_big_V = V_heap.back();
            push_heap(V_heap.begin(), V_heap.end());

            V_cuts.insert(distance);
/*
            V_cuts.insert(distance);

            if(distance > V_lower && distance < V_upper){
                auto first = V_cuts.begin();
                auto after = V_cuts.begin();
                ++after;
                big_V = 0;
                for(; after != V_cuts.end(); ++first, ++after){
                    diff = *after - *first;
                    if(diff > big_V){
                        big_V = diff;
                        V_lower = *first;
                        V_upper = *after;
                        if(big_V == last_big_V){
                            break;
                        }
                    }
                }
                last_big_V = big_V;
            }
*/
        }
        std::cout << (last_big_H*last_big_V) << std::endl;
    }
    return 0;
}


#include <iostream>
#include <set>

int main(){
    int w, h, n;
    std::cin >> w >> h >> n;

    std::set<int> H_cuts;
    std::set<int> V_cuts;
    H_cuts.insert(0);
    H_cuts.insert(h);
    V_cuts.insert(0);
    V_cuts.insert(w);

    int last_big_H = h;
    int last_big_V = w;

    std::string direction;
    int distance;
    int diff;
    int big_H;
    int big_V;
    for(int i = 0; i < n; ++i){
        std::cin >> direction >> distance;

        if(direction == "H"){
            H_cuts.insert(distance);
            auto first = H_cuts.begin();
            auto after = H_cuts.begin();
            ++after;
            big_H = 0;
            for(; after != H_cuts.end(); ++first, ++after){
                diff = *after - *first;
                if(diff > big_H){
                    big_H = diff;
                    if(big_H == last_big_H){
                        break;
                    }
                }
            }
            last_big_H = big_H;
        }
        else{
            V_cuts.insert(distance);
            auto first = V_cuts.begin();
            auto after = V_cuts.begin();
            ++after;
            big_V = 0;
            for(; after != V_cuts.end(); ++first, ++after){
                diff = *after - *first;
                if(diff > big_V){
                    big_V = diff;
                    if(big_V == last_big_V){
                        break;
                    }
                }
            }
            last_big_V = big_V;
        }
        std::cout << (last_big_H*last_big_V) << std::endl;
    }
    return 0;
}


#include <iostream>
#include <set>
#include <cstdint>
#include <vector>
#include <algorithm>

int main(){
    int64_t w, h, n;
    std::cin >> w >> h >> n;

    std::set<int64_t> H_cuts;
    std::set<int64_t> V_cuts;
    H_cuts.insert(0);
    H_cuts.insert(h);
    V_cuts.insert(0);
    V_cuts.insert(w);

    int64_t last_big_H = h;
    int64_t last_big_V = w;

    std::vector<int64_t> H_heap {h};
    std::vector<int64_t> V_heap {w};

    std::string direction;
    int64_t distance;
    int64_t diff;
    int64_t big_H, H_lower = 0, H_upper = h;
    int64_t big_V, V_lower = 0, V_upper = w;
    for(int64_t i = 0; i < n; ++i){
        std::cin >> direction >> distance;

        if(direction == "H"){

            auto it = H_cuts.lower_bound(distance);
            int64_t lower = *it;
            int64_t upper = *(++it);

            H_heap.erase(find(H_heap.begin(), H_heap.end(), upper-lower));

            H_heap.push_back(distance-lower);
            H_heap.push_back(upper-distance);
            pop_heap(H_heap.begin(), H_heap.end());
            last_big_H = H_heap.back();
            push_heap(H_heap.begin(), H_heap.end());

            H_cuts.insert(distance);

            /*if(distance > H_lower && distance < H_upper){
            }*/

            /*if(distance > H_lower && distance < H_upper){
                auto first = H_cuts.begin();
                auto after = H_cuts.begin();
                ++after;
                big_H = 0;
                for(; after != H_cuts.end(); ++first, ++after){
                    diff = *after - *first;
                    if(diff > big_H){
                        big_H = diff;
                        H_lower = *first;
                        H_upper = *after;
                        if(big_H == last_big_H){
                            break;
                        }
                    }
                }
                last_big_H = big_H;
            }*/

        }
        else{
            auto it = V_cuts.lower_bound(distance);
            int64_t lower = *it;
            int64_t upper = *(++it);

            V_heap.erase(find(V_heap.begin(), V_heap.end(), upper-lower));

            V_heap.push_back(distance-lower);
            V_heap.push_back(upper-distance);
            pop_heap(V_heap.begin(), V_heap.end());
            last_big_H = V_heap.back();
            push_heap(V_heap.begin(), V_heap.end());

            V_cuts.insert(distance);
/*
            V_cuts.insert(distance);

            if(distance > V_lower && distance < V_upper){
                auto first = V_cuts.begin();
                auto after = V_cuts.begin();
                ++after;
                big_V = 0;
                for(; after != V_cuts.end(); ++first, ++after){
                    diff = *after - *first;
                    if(diff > big_V){
                        big_V = diff;
                        V_lower = *first;
                        V_upper = *after;
                        if(big_V == last_big_V){
                            break;
                        }
                    }
                }
                last_big_V = big_V;
            }
*/
        }
        std::cout << (last_big_H*last_big_V) << std::endl;
    }
    return 0;
}


#include <iostream>
#include <set>

int main(){
    int w, h, n;
    std::cin >> w >> h >> n;

    std::set<int> H_cuts;
    std::set<int> V_cuts;
    H_cuts.insert(0);
    H_cuts.insert(h);
    V_cuts.insert(0);
    V_cuts.insert(w);

    int last_big_H = h;
    int last_big_V = w;

    std::string direction;
    int distance;
    int diff;
    int big_H, H_lower = 0, H_upper = h;
    int big_V, V_lower = 0, V_upper = w;
    for(int i = 0; i < n; ++i){
        std::cin >> direction >> distance;

        if(direction == "H"){
            H_cuts.insert(distance);

            if(distance > H_lower && distance < H_upper){
                auto first = H_cuts.begin();
                auto after = H_cuts.begin();
                ++after;
                big_H = 0;
                for(; after != H_cuts.end(); ++first, ++after){
                    diff = *after - *first;
                    if(diff > big_H){
                        big_H = diff;
                        H_lower = *first;
                        H_upper = *after;
                        if(big_H == last_big_H){
                            break;
                        }
                    }
                }
                last_big_H = big_H;
            }

        }
        else{
            V_cuts.insert(distance);

            if(distance > V_lower && distance < V_upper){
                auto first = V_cuts.begin();
                auto after = V_cuts.begin();
                ++after;
                big_V = 0;
                for(; after != V_cuts.end(); ++first, ++after){
                    diff = *after - *first;
                    if(diff > big_V){
                        big_V = diff;
                        V_lower = *first;
                        V_upper = *after;
                        if(big_V == last_big_V){
                            break;
                        }
                    }
                }
                last_big_V = big_V;
            }
        }
        std::cout << (last_big_H*last_big_V) << std::endl;
    }
    return 0;
}


#include <iostream>
#include <set>
#include <cstdint>
#include <vector>
#include <algorithm>

int main(){
    int64_t w, h, n;
    std::cin >> w >> h >> n;

    std::set<int64_t> H_cuts;
    std::set<int64_t> V_cuts;
    H_cuts.insert(0);
    H_cuts.insert(h);
    V_cuts.insert(0);
    V_cuts.insert(w);

    int64_t last_big_H = h;
    int64_t last_big_V = w;

    std::vector<int64_t> H_heap {h};
    std::vector<int64_t> V_heap {w};

    std::string direction;
    int64_t distance;
    int64_t diff;
    int64_t big_H, H_lower = 0, H_upper = h;
    int64_t big_V, V_lower = 0, V_upper = w;
    for(int64_t i = 0; i < n; ++i){
        std::cin >> direction >> distance;

        if(direction == "H"){

            auto it = H_cuts.lower_bound(distance);
            int64_t upper = *it;
            int64_t lower = *(--it);

            H_heap.erase(find(H_heap.begin(), H_heap.end(), upper-lower));

            H_heap.push_back(distance-lower);
            H_heap.push_back(upper-distance);
            pop_heap(H_heap.begin(), H_heap.end());
            last_big_H = H_heap.back();
            push_heap(H_heap.begin(), H_heap.end());

            H_cuts.insert(distance);

            /*if(distance > H_lower && distance < H_upper){
            }*/

            /*if(distance > H_lower && distance < H_upper){
                auto first = H_cuts.begin();
                auto after = H_cuts.begin();
                ++after;
                big_H = 0;
                for(; after != H_cuts.end(); ++first, ++after){
                    diff = *after - *first;
                    if(diff > big_H){
                        big_H = diff;
                        H_lower = *first;
                        H_upper = *after;
                        if(big_H == last_big_H){
                            break;
                        }
                    }
                }
                last_big_H = big_H;
            }*/

        }
        else{
            auto it = V_cuts.lower_bound(distance);
            int64_t upper = *it;
            int64_t lower = *(--it);

            V_heap.erase(find(V_heap.begin(), V_heap.end(), upper-lower));

            V_heap.push_back(distance-lower);
            V_heap.push_back(upper-distance);
            pop_heap(V_heap.begin(), V_heap.end());
            last_big_V = V_heap.back();
            push_heap(V_heap.begin(), V_heap.end());

            V_cuts.insert(distance);
/*
            V_cuts.insert(distance);

            if(distance > V_lower && distance < V_upper){
                auto first = V_cuts.begin();
                auto after = V_cuts.begin();
                ++after;
                big_V = 0;
                for(; after != V_cuts.end(); ++first, ++after){
                    diff = *after - *first;
                    if(diff > big_V){
                        big_V = diff;
                        V_lower = *first;
                        V_upper = *after;
                        if(big_V == last_big_V){
                            break;
                        }
                    }
                }
                last_big_V = big_V;
            }
*/
        }
        std::cout << (last_big_H*last_big_V) << std::endl;
    }
    return 0;
}


#include <iostream>
#include <set>
#include <cstdint>
#include <vector>
#include <algorithm>

int main(){
    int64_t w, h, n;
    std::cin >> w >> h >> n;

    std::set<int64_t> H_cuts;
    std::set<int64_t> V_cuts;
    H_cuts.insert(0);
    H_cuts.insert(h);
    V_cuts.insert(0);
    V_cuts.insert(w);

    int64_t last_big_H = h;
    int64_t last_big_V = w;

    std::vector<int64_t> H_heap {h};
    std::vector<int64_t> V_heap {w};

    std::string direction;
    int64_t distance;
    int64_t diff;
    int64_t big_H, H_lower = 0, H_upper = h;
    int64_t big_V, V_lower = 0, V_upper = w;
    for(int64_t i = 0; i < n; ++i){
        std::cin >> direction >> distance;

        if(direction == "H"){

            auto it = H_cuts.lower_bound(distance);
            int64_t upper = *it;
            int64_t lower = *(--it);

            H_heap.erase(find(H_heap.begin(), H_heap.end(), upper-lower));

            H_heap.push_back(distance-lower);
            H_heap.push_back(upper-distance);
            pop_heap(H_heap.begin(), H_heap.end());
            last_big_H = H_heap.back();
            push_heap(H_heap.begin(), H_heap.end());

            H_cuts.insert(distance);

            /*if(distance > H_lower && distance < H_upper){
            }*/

            /*if(distance > H_lower && distance < H_upper){
                auto first = H_cuts.begin();
                auto after = H_cuts.begin();
                ++after;
                big_H = 0;
                for(; after != H_cuts.end(); ++first, ++after){
                    diff = *after - *first;
                    if(diff > big_H){
                        big_H = diff;
                        H_lower = *first;
                        H_upper = *after;
                        if(big_H == last_big_H){
                            break;
                        }
                    }
                }
                last_big_H = big_H;
            }*/

        }
        else{
            auto it = V_cuts.lower_bound(distance);
            int64_t upper = *it;
            int64_t lower = *(--it);

            V_heap.erase(find(V_heap.begin(), V_heap.end(), upper-lower));

            V_heap.push_back(distance-lower);
            V_heap.push_back(upper-distance);
            pop_heap(V_heap.begin(), V_heap.end());
            last_big_H = V_heap.back();
            push_heap(V_heap.begin(), V_heap.end());

            V_cuts.insert(distance);
/*
            V_cuts.insert(distance);

            if(distance > V_lower && distance < V_upper){
                auto first = V_cuts.begin();
                auto after = V_cuts.begin();
                ++after;
                big_V = 0;
                for(; after != V_cuts.end(); ++first, ++after){
                    diff = *after - *first;
                    if(diff > big_V){
                        big_V = diff;
                        V_lower = *first;
                        V_upper = *after;
                        if(big_V == last_big_V){
                            break;
                        }
                    }
                }
                last_big_V = big_V;
            }
*/
        }
        std::cout << (last_big_H*last_big_V) << std::endl;
    }
    return 0;
}


/*
#include<deque>
#include<list>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<vector>
#include<algorithm>
#include<functional>
#include<iterator>
#include<locale>
#include<memory>
#include<stdexcept>
#include<utility>
#include<string>
#include<fstream>
#include<ios>
#include<iostream>
#include<iosfwd>
#include<iomanip>
#include<istream>
#include<ostream>
#include<sstream>
#include<streambuf>
#include<complex>
#include<numeric>
#include<valarray>
#include<exception>
#include<limits>
#include<new>
#include<typeinfo>*/
#include <bits/stdc++.h>

#define fp 				pop_front
#define bp 				pop_back
#define all(x) 			x.begin() , x.end()
#define mp 				make_pair
#define pb 				push_back
#define pf 				push_front
#define se 				second
#define f 				first
#define sz 				size()
#define sqr(x) 			((x) * (x))
#define cub(x) 			sqr(x) * (x)
#define ios 			std::ios_base::sync_with_stdio(false); std::cin.tie(0); std::cout.tie(0);
#define y1 				qazwsxedcrfvtgbyhnujmik
#define LOGMAX          17
#define MX              1 << 22
#define l(n)            n << 1
#define r(n)            (n << 1) + 1
#define FIND(N,pos)     ((N) & (1 << (pos)))
#define sf(h)           scanf("%d",&h)
#define sff(h,b)        scanf("%d%d",&h,&b)
#define sfff(h,b,c)     scanf("%d%d%d",&h,&b,&c)
#define TCASE(test)     for(int z = 1;z <= test;z++)
#define PRINT           printf("Case %d:\n",z)
#define en              "\n"
#define lwb             lower_bound
#define upb             upper_bound
#define	pii				pair < int , int >
#define	pil				pair < int , long long >
#define	pli				pair < long long , int >
#define	pll				pair < long long , long long >
#define int long long

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

const int inf = 1e9 + 7;
const ll ll_inf = 1e18 + 420;
const double eps = 1e-4;
const int N = 1e6 + 7;
const int MAX = 2e5 + 9;

int w, h, n, k;
char c;
multiset < int > msx, msy, msdx, msdy;

main(){
	ios
	cin >> w >> h >> n;
	msx.insert(w);
	msy.insert(h);
	msx.insert(0);
	msy.insert(0);
	msdx.insert(w);
	msdy.insert(h);
	for(int i = 0; i < n; ++i){
	 	cin >> c >> k;
	 	if(c == 'H'){
	 	 	msy.insert(k);
	 	 	int last = *(msy.upb(k)) - *(--msy.lwb(k));
	 	 	//cout << last ;
	 	 	//return 0;
	 	 	int res1 = *(msy.lwb(k)) - *(--msy.lwb(k));
	 	 	int res2 = *(msy.upb(k)) - *(msy.lwb(k));
	 	 	//cout << res1 << " " << res2;
	 	 	//return 0;
	 	 	msdy.erase(msdy.find(last));
	 	 	msdy.insert(res1);
	 	 	msdy.insert(res2);
	 	}
	 	else{
	 		//cout << 1 << en;
	 	 	msx.insert(k);
	 	 	//cout << 1 << en;
	 	 	int last = *(msx.upb(k)) - *(--msx.lwb(k));
	 	 	int res1 = *(msx.lwb(k)) - *(--msx.lwb(k));
	 	 	int res2 = *(msx.upb(k)) - *(msx.lwb(k));
	 	 	//cout << 1 << en;
	 	 	//cout << last << en;
	 	 	msdx.erase(msdx.find(last));
	 	 	//cout << 1 << en;
	 	 	msdx.insert(res1);
	 	 	msdx.insert(res2);
	 	}
	 	cout <<( *(msdy.rbegin())) * (*(msdx.rbegin())) << en;
	}
}