#include <iostream>
#include <string>
#include <string.h>
#include <vector>
#include <algorithm>

using namespace std;

#define For(i,a,n)	for(int i = a;i < n;i++)
#define rep(i,n)	For(i,0,n)
#define clr(n)		memset(n,0,sizeof n)
#define all(n)		(n).begin(),(n).end()

int main()
{
	int n, w, d;
	
	while (cin >> n >> w >> d && (n || w || d)){

		vector<int> x, y;
		x.push_back(w), y.push_back(d);

		rep(i, n){
			int p, s;
			cin >> p >> s;
			p--;

			int d[4] = { x[p], y[p], x[p], y[p] };
			int t = -1;

			s = s % (x[p] * 2 + y[p] * 2);
			
			for (int j = 0; j < 4; j++){
				if (s < d[j]){
					t = j; break;
				}
				else{
					s -= d[j];
				}
			}
			int nx1, nx2;
			if (t % 2 == 0){
				nx1 = x[p] - s;
				nx2 = s;

				int ty = y[p];
				x.erase(x.begin() + p);
				y.erase(y.begin() + p);
				x.push_back(min(nx1, nx2));
				x.push_back(max(nx1, nx2));
				y.push_back(ty);
				y.push_back(ty);
			}
			else{
				nx1 = y[p] - s;
				nx2 = s;

				int tx = x[p];
				x.erase(x.begin() + p);
				y.erase(y.begin() + p);
				y.push_back(min(nx1, nx2));
				y.push_back(max(nx1, nx2));
				x.push_back(tx);
				x.push_back(tx);
			}
		}

		vector<int> ans;
		rep(i, x.size()){
			ans.push_back(x[i] * y[i]);
		}
		sort(all(ans));
		rep(i, ans.size()){
			if (i == ans.size() - 1)
				cout << ans[i] << endl;
			else
				cout << ans[i] << " ";
		}
	}
	return 0;
}