#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define INF 1000000010
#define EPS 1e-9
#define fst first
#define scd second

#define debug(x) cout<<x<<endl;
#define repi(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) repi(i,0,n)
#define lp(i,n) repi(i,0,n)
#define repn(i,n) for(int i=n;i>=0;i--)
#define int long long
#define endl "\n"


signed main(){
  cin.tie(0);	
  ios::sync_with_stdio(false);
  while(1){
    int n,w,d;
    cin>>n>>w>>d;
    if(n==0 && w==0 && d==0) break;
    vector<pair<int,pair<int,int> > >cake;
    cake.push_back(make_pair(w*d,make_pair(w,d)));
    int p[100],s[100];
    rep(i,n){
      cin>>p[i]>>s[i];
      pair<int,pair<int,int> > now;
      now=cake[p[i]-1];
      int ww=now.scd.fst,dd=now.scd.scd;
      cake.erase(cake.begin()+p[i]-1);
      while(s[i]>(ww+dd)) s[i]-=ww+dd;
      if(s[i]>ww){
	s[i]-=ww;
	cake.push_back(make_pair(ww*min(dd-s[i],s[i]),make_pair(ww,min(dd-s[i],s[i]))));
	cake.push_back(make_pair(ww*max(dd-s[i],s[i]),make_pair(ww,max(dd-s[i],s[i]))));
      }else{
	cake.push_back(make_pair(dd*min(ww-s[i],s[i]),make_pair(min(ww-s[i],s[i]),dd)));
	cake.push_back(make_pair(dd*max(ww-s[i],s[i]),make_pair(max(ww-s[i],s[i]),dd)));
      }
    }
    sort(cake.begin(),cake.end() );
    rep(i,cake.size() ){
      cout<<cake[i].fst;
      if(i!=cake.size() -1) cout<<" ";
    }
    cout<<endl;
  }
	
    

  return 0;
}
