#include<list>
#include<algorithm>
#include<iostream>
#include<string>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
  int i,j;
  int b[101],n,p,q,w,h;
  list<pair<int,int> > a;
  list<pair<int,int> >::iterator it;
  while(cin>>n>>w>>h&&n+w+h){
    a.clear();
    a.push_back(make_pair(w,h));
    for(i=0;i<n;i++){
      cin>>p>>q;
      it=a.begin();
      for(j=0;j<p-1;j++)
	it++;
      q%=(*it).first+(*it).second;
      if(0){
      }else if(q<(*it).first){
	if(q<(*it).first-q){
	  a.push_back(make_pair(q,(*it).second));
	  a.push_back(make_pair((*it).first-q,(*it).second));
	}else{
	  a.push_back(make_pair((*it).first-q,(*it).second));
	  a.push_back(make_pair(q,(*it).second));
	}
      }else if(q<(*it).first+(*it).second){
	q-=(*it).first;
	if(q<(*it).second-q){
	  a.push_back(make_pair((*it).first,q));
	  a.push_back(make_pair((*it).first,(*it).second-q));
	}else{
	  a.push_back(make_pair((*it).first,(*it).second-q));
	  a.push_back(make_pair((*it).first,q));
	}
      }
      a.erase(it);
    }
    i=0;
    for(it=a.begin();it!=a.end();it++){
      b[i]=(*it).first*(*it).second;
      i++;
    }
    sort(b,b+n+1);
    for(i=0;i<n;i++)
      cout<<b[i]<<" ";
    cout<<b[i]<<endl;
  }
  return 0;
}