#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>
#include<stack>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
typedef vector<string> vstring;
typedef vector<pint> vpint;

struct Edge{int to,from,cost;};

#ifdef DEBUG
#define debug cout
#else
stringstream __ss__;
#define debug __ss__
#endif

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) debug << *i << " "; debug << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

#define rep(i,n) for(int i=0;i<(n);++i)
#define repd(i,n) for(int i=(n)-1;i>=0;--i)
#define repn(i,m,n) for(int i=(m);i<=(n);++i)
#define repnd(i,m,n) for(int i=(n)-1;i>=(m);--i)
#define rep0(i,n) for(i=0;i<(n);++i)
#define repd0(i,n) for(i=(n)-1;i>=0;--i)
#define repn0(i,m,n) for(i=(m);i<=(n);++i)
#define repnd0(i,m,n) for(i=(n)-1;i>=(m);--i)
#define all(n) n.begin(),n.end()
#define sz(n) ((int)(n).size())
#define IL for(;;)
#define MP make_pair
#define PB push_back
#define SS stringstream
#define X second
#define Y first
#define PUTLINE debug<<"LINE:"<<__LINE__<<endl;

const int INF = 2147483647/3;
const double EPS = 1e-10;
const double PI = acos(-1.0);

const int dx[]={1,-1,0,0,1,-1,1,-1,0};
const int dy[]={0,0,1,-1,1,-1,-1,1,0};

vpint cakes;

void cut1(int a,int b){
	if(b<cakes[a].first-b){
		cakes.PB(MP(b,cakes[a].second));
		cakes.PB(MP(cakes[a].first-b,cakes[a].second));
	}else{
		cakes.PB(MP(cakes[a].first-b,cakes[a].second));
		cakes.PB(MP(b,cakes[a].second));
	}
}

void cut2(int a,int b){
	if(b<cakes[a].second-b){
		cakes.PB(MP(cakes[a].first,b));
		cakes.PB(MP(cakes[a].first,cakes[a].second-b));
	}else{
		cakes.PB(MP(cakes[a].first,cakes[a].second-b));
		cakes.PB(MP(cakes[a].first,b));
	}
}

int main() {
	int n,w,d,p,s;
	IL{
		cin>>n>>w>>d;
		if(n==0&&w==0&&d==0)break;
		cakes.clear();
		cakes.PB(MP(w,d));
		rep(i,n){
			cin>>p>>s;
			--p;
			//cout<<cakes[p].first<<" "<<cakes[p].second<<endl;
			if(s%(2*(cakes[p].first+cakes[p].second))<cakes[p].first){
				cut1(p,s%(cakes[p].first+cakes[p].second));
			}else if(s%(2*(cakes[p].first+cakes[p].second))<cakes[p].first+cakes[p].second){
				cut2(p,s%(cakes[p].first+cakes[p].second)-cakes[p].first);
			}else if(s%(2*(cakes[p].first+cakes[p].second))<2*cakes[p].first+cakes[p].second){
				cut1(p,cakes[p].first-s%(cakes[p].first+cakes[p].second));
			}else{
				cut2(p,cakes[p].second-(s%(cakes[p].first+cakes[p].second)-cakes[p].first));
			}
			vpint next;
			//cout<<sz(cakes)<<endl;
			rep(j,sz(cakes)){
				if(j!=p){
					next.PB(cakes[j]);
				}
			}
			cakes=next;
			//cout<<sz(cakes)<<endl;
			//cout<<cakes[sz(cakes)-1].first<<" "<<cakes[sz(cakes)-1].second<<endl;
			//cout<<cakes[sz(cakes)-2].first<<" "<<cakes[sz(cakes)-2].second<<endl;
		}
		vint res;
		rep(i,n+1){
			res.PB(cakes[i].first*cakes[i].second);
		}
		sort(all(res));
		rep(i,n+1){
			if(i!=0)cout<<" ";
			cout<<res[i];
		}
		cout<<endl;
	}
	return 0;
}

Measured memory_bytes: 0