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

#define for_(i,a,b) for(int i=a;i<b;++i)
#define allof(a) a.begin(),a.end()
#define minit(a,b) memset(a,b,sizeof(a))

typedef long long lint;
typedef pair<int, int> pii;

struct Cake {
	int w, d;
	
	Cake(int _w, int _d) : w(_w), d(_d) {}
	
	int area() { return w * d; }
		
	vector<Cake> cut_in(int s) {
		vector<Cake> res;
		
		int cnt = 0;
		while (1) {
			if (cnt % 2 == 0) {
				if (s <= w) break;
				s -= w;
				cnt++;
			} else {
				if (s <= d) break;
				s -= d;
				cnt++;
			}
		}
		
		if (cnt % 2 == 0) {
			res.push_back(Cake(s, d));
			res.push_back(Cake(w - s, d));
		} else {
			res.push_back(Cake(w, s));
			res.push_back(Cake(w, d - s));
		}
		
		if (res[0].area() > res[1].area()) swap(res[0], res[1]);
		return res;
	}
};

int n, w, d;

void solve() {
	vector<Cake> vc;
	vc.push_back(Cake(w,d));
	
	for_(i,0,n) {
		int p, s; cin >> p >> s;
		--p;
		
		int c_size = (int)vc.size();
		vector<Cake> sub;
		for_(j,0,c_size) if (j != p) sub.push_back(vc[j]);
		
		vector<Cake> cuts = vc[p].cut_in(s);
		sub.push_back(cuts[0]);
		sub.push_back(cuts[1]);
		
		vc = sub;
	}
	
	vector<int> ans;
	for_(i,0,n + 1) ans.push_back(vc[i].area());
	sort(allof(ans));
	for_(i,0,n + 1) {
		if (i < n) cout << ans[i] << " ";
		else cout << ans[i] << endl;
	}
}

int main() {
	while (cin >> n >> w >> d) {
		if (n == 0 && w == 0 && d == 0) break;
		solve();
	}
	return 0;
}