#include <bits/stdc++.h>
#define  rep(i,n) for(int i =0; i<(int)(n);i++)
#define  REP(i,k,n) for(int i =k; i<(int)(n);i++)

#define vi vector<int>
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define tup tuple<int,int,int>
#define fi first
#define se second
typedef long long ll;
const int inf = 100100100;

using namespace std;

int main(){

    int n,w,h;
    while(cin >> n >> w >> h,w){
        int p[110] = {};
        int s[110] = {};
        rep(i,n) cin >> p[i] >> s[i];
        pii G[10100] = {};
        int now=1;
        G[0]=make_pair(w,h);
        for(int i=0;i<n;i++){
            int d = p[i];
            int e = s[i];
            int t=e%(G[d-1].fi+G[d-1].se);
            if(t<G[d-1].fi){
                G[now]=make_pair(min(t,G[d-1].fi-t),G[d-1].se);
                G[now+1]=make_pair(max(t,G[d-1].fi-t),G[d-1].se);
            }else{
                t-=G[d-1].fi;
                G[now]=make_pair(G[d-1].fi,min(t,G[d-1].se-t));
                G[now+1]=make_pair(G[d-1].fi,max(t,G[d-1].se-t));
            }
            G[d-1]=make_pair(-1,-1);
            now++;
            for(int j=0;j<now;j++){
                if(G[j].fi==-1){
                    for(int k=j;k<now;k++)G[k]=G[k+1];
                    break;
                }
            }

        }
        for(int i=0;i<now;i++)s[i]=G[i].fi*G[i].se;
        sort(s,s+now);
        rep(i,now-1) cout << s[i] << " ";
        cout << s[now-1] << endl;
    }
    return 0;
}
