#include <iostream>
#define F first
#define S second
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
vector<int> ans;
int n,h,w,a,b,c,d,H,W;
vector<P> v,u;
int main(void){
    while(1){
    cin>>n>>h>>w;
    if(n==0&&h==0&&w==0)return 0;
    v={};
    u={};
    ans={};
    v.push_back({h,w});
    for(int i=0;i<n;i++){
        cin>>a>>b;
        a--;
        for(int i=0;i<v.size();i++){
            if(i==a){
                H=v[i].F,W=v[i].S;
            }
            else{
                u.push_back({v[i].F,v[i].S});
            }
        }
        b%=(H+W);
        if(1<=b&&b<H){
            c=b,d=H-b;
            if(c<d)swap(c,d);
            u.push_back({d,W});
            u.push_back({c,W});
        }
        else{
            b-=H;
            c=b,d=W-b;
            if(c<d)swap(c,d);
            u.push_back({H,d});
            u.push_back({H,c});
        }
        v={};
        for(auto x:u)v.push_back({x.F,x.S});
        u={};
    }
    for(auto x:v){ans.push_back(x.F*x.S);}//cout<<x.F<<" "<<x.S<<endl;}
    sort(ans.begin(),ans.end());
    for(int i=0;i<ans.size();i++){
        if(i)cout<<" ";
        cout<<ans[i];
    }
    cout<<endl;
    }
}

