#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;


void solve(int n,int w,int h){
    vector<pair<int,int>> v;
    v.emplace_back(h,w);
    rep(i,n){
        int k,x;
        cin>>k>>x;
        --k;
        auto p=v[k];
        vector<pair<int,int>> nv;
        rep(j,v.size())if(j!=k)nv.push_back(v[j]);
        h=p.first;w=p.second;
        x%=(h+w);
        if(x<w){
            nv.emplace_back(h,min(x,w-x));
            nv.emplace_back(h,max(x,w-x));
        }
        else {
            nv.emplace_back(min(h+w-x,x-w),w);
            nv.emplace_back(max(h+w-x,x-w),w);
        }
        v.swap(nv);
    }
    sort(v.begin(),v.end(),[](pair<int,int> x,pair<int,int> y){
        return x.first*x.second<y.first*y.second;
    });
    rep(i,v.size()){
        auto p=v[i];
        cout<<p.first*p.second;
        if(i!=n)cout<<" ";
    }
    cout<<endl;
}
int main(){
    int n,w,h;
    while(cin>>n>>w>>h,w!=0)solve(n,w,h);
    return 0;
}
