#include "bits/stdc++.h"
using namespace std;

#define int long long 
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,m,n) for(int i=m;i<(n);i++)
#define ALL(v) v.begin(),v.end()

int h[1010], w[1010];
void solve() {
	int N;
	REP(i, 105) {
		w[i] = h[i] = 0;
	}
	cin >> N >> w[0] >> h[0];
	if (N == 0 && w[0] == 0)exit(0);
	int idx = 1;
	REP(i, N) {
		int id, s; cin >> id >> s;
		id--;
		int H = h[id], W = w[id];
		s %= (H + W);
		//cout << "s:" << s << endl;
		FOR(j,id+1,i+1){
			h[j-1]=h[j];
			w[j-1]=w[j];
		}
		if (s<W) {
			int w1 = s, w2 = W - s;
			if (w1>w2)swap(w1, w2);
			w[i] = w1;
			h[i] = H;
			w[i+1] = w2;
			h[i+1] = H;
		}
		else {
			s -= W;
			int h1 = s, h2 = H - s;
			if (h1>h2)swap(h1, h2);
			h[i] = h1;
			w[i]=W;
			h[i+1] = h2;
			w[i+1] = W;
		}
	}
	vector<int>v;
	REP(i, N+1) {
		v.push_back(h[i] * w[i]);
	}
	sort(ALL(v));
	int M = v.size();
	REP(i, M) {
		cout << v[i];
		if (i != M - 1)cout << " ";
	}
	cout << endl;
	//cout << "+++++" << endl;
}
signed main() {
	while (true)
		solve();
}

