#include<bits/stdc++.h>
#define f first
#define s second
#define mp make_pair
using namespace std;

class cake{
public:
  int w,d;
  cake(int w=0,int d=0):w(w),d(d){}

  int get_area(){ return w*d; }

  pair<cake,cake> cut(int S){
    pair<cake,cake> pc;
    S=S%(2*w+2*d);
    if(S<w){
      pc.f=cake(w-S,d);
      pc.s=cake(S,d);
    }
    else  if(S<w+d){
      pc.f=cake(w,d+w-S);
      pc.s=cake(w,S-w);
    }
    else if(S<2*w+d){
      pc.f=cake(S-(w+d),d);
      pc.s=cake((2*w+d)-S,d);
    }
    else {
      pc.f=cake(w,(2*w+2*d)-S);
      pc.s=cake(w,S-(2*w+d));
    }
    return pc;
  }
  bool operator<(cake c)const{
    return w*d<c.get_area();
  }
};

int main()
{
  int n,w,d,p,s;

  while(1){
    cin>>n>>w>>d;
    if(n+w+d==0)break;
    vector<cake> vc;
    vc.push_back(cake(w,d));
    for(int i=0;i<n;i++){
      cin>>p>>s;
      p--;
      cake c=vc[p];
      vc.erase(vc.begin()+p);
      pair<cake,cake> pc=c.cut(s);
      if(pc.f.get_area()<=pc.s.get_area()){
	vc.push_back(pc.f);
	vc.push_back(pc.s);
      }
      else {
	vc.push_back(pc.s);
	vc.push_back(pc.f);
      }
    }
    sort(vc.begin(),vc.end());
    for(int i=0;i<vc.size();i++){
      cout<<vc[i].get_area();
      if(i!=vc.size()-1)cout<<" ";
    }
    cout<<endl;
  }
  return 0;
}