#include "bits/stdc++.h"
#include <sys/timeb.h>
#include <fstream>

using namespace std;

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define replrev(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define reprev(i,n) replrev(i,0,n)
#define repi(itr,ds) for(auto itr=ds.begin();itr!=ds.end();itr++)
#define all(a) a.begin(),a.end()
#define mp make_pair
#define mt make_tuple
#define INF 2000000000
#define INFL 1000000000000000000LL
#define EPS 1e-9
#define MOD 1000000007
#define PI 3.1415926536
#define RMAX 4294967295

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<P> vP;
typedef vector<vector<int> > vvi;
typedef vector<vector<bool> > vvb;
typedef vector<vector<ll> > vvll;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<double> > vvd;
typedef vector<vector<P> > vvP;
typedef priority_queue<int, vector<int>, greater<int> > pqli;
typedef priority_queue<ll, vector<ll>, greater<ll> > pqlll;
typedef priority_queue<P, vector<P>, greater<P> > pqlP;
typedef pair<int, pair<int, int> > Edge;
typedef vector<Edge> vE;
typedef priority_queue<Edge, vector<Edge>, greater<Edge> > pqlE;


int main() {
	while (true) {
		int N, W, H;
		cin >> N >> W >> H;
		if (W == 0)break;
		vector<tuple<int, int, int>> pieces;
		pieces.push_back(mt(W*H, H, W));
		rep(i, N) {
			int p, s;
			cin >> p >> s;
			p--;
			int h = get<1>(pieces[p]);
			int w = get<2>(pieces[p]);
			s %= 2 * (h + w);
			repl(j, p, pieces.size() - 1) {
				pieces[j] = pieces[j + 1];
			}
			if (s < w) {
				if (s <= w / 2) {
					pieces[pieces.size() - 1] = mt(s*h, h, s);
					pieces.push_back(mt((w - s)*h, h, w - s));
				}
				else {
					pieces[pieces.size() - 1] = mt((w - s)*h, h, w - s);
					pieces.push_back(mt(s*h, h, s));
				}
			}
			else if (s < w + h) {
				if (s - w <= h / 2) {
					pieces[pieces.size() - 1] = mt((s - w)*w, s - w, w);
					pieces.push_back(mt((h + w - s)*w, h + w - s, w));
				}
				else {
					pieces[pieces.size() - 1] = mt((h + w - s)*w, h + w - s, w);
					pieces.push_back(mt((s - w)*w, s - w, w));
				}
			}
			else if (s < 2 * w + h) {
				if (s - (w + h) <= w / 2) {
					pieces[pieces.size() - 1] = mt((s - (w + h))*h, h, s - (w + h));
					pieces.push_back(mt((2 * w + h - s)*h, h, 2 * w + h - s));
				}
				else {
					pieces[pieces.size() - 1] = mt((2 * w + h - s)*h, h, 2 * w + h - s);
					pieces.push_back(mt((s - (w + h))*h, h, s - (w + h)));
				}
			}
			else {
				if (s - (2 * w + h) <= h / 2) {
					pieces[pieces.size() - 1] = mt((s - (2 * w + h))*w, s - (2 * w + h), w);
					pieces.push_back(mt((2 * (w + h) - s)*w, 2 * (h + w) - s, w));
				}
				else {
					pieces[pieces.size() - 1] = mt((2 * (w + h) - s)*w, 2 * (h + w) - s, w);
					pieces.push_back(mt((s - (2 * w + h))*w, s - (2 * w + h), w));
				}
			}
			/*
			cout << i << endl;
			rep(j, pieces.size()) {
				cout << get<0>(pieces[j]) << " " << get<1>(pieces[j]) << " " << get<2>(pieces[j]) << endl;
			}
			*/
		}
		sort(all(pieces));
		rep(i, pieces.size()) {
			cout << get<0>(pieces[i]);
			if (i < pieces.size() - 1) {
				cout << " ";
			}
			else {
				cout << endl;
			}
		}
	}

	return 0;
}

Measured memory_bytes: 2996