#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;


class peace{
public:
	pair<int,int> lu,rd;
	int num;

	int getWidhMergine()const{
		return rd.second -lu.second;
	}

	int getHightMergine()const{
		return rd.first - lu.first;
	}

	bool operator<(const peace &pp)const{
		return pp.getHightMergine()*pp.getWidhMergine() > (this->getHightMergine()*this->getWidhMergine());
	}

};

int main(){

	int n,w,d;

	while(cin >> n >> w >> d && !(n == 0 && w == 0 && d == 0)){
		vector<peace> peaces;
		peace pe;
		pe.lu.first = 0;
		pe.lu.second = 0;
		pe.rd.first = d;
		pe.rd.second = w;
		pe.num = 1;

		peaces.push_back(pe);
		int p,s;
		for(int i = 0; i < n; i++){
			cin >> p >> s;
			peace pe[2];
			int newNumBase = 0;
			int erIdx;
			for(int j = 0; j < peaces.size(); j++){
				if(peaces[j].num==p){
					int tmp = peaces[j].getHightMergine()+peaces[j].getWidhMergine();
					s = s % (2*(peaces[j].getHightMergine()+peaces[j].getWidhMergine()));
					if(peaces[j].getWidhMergine() >= s){
						// cÉª
						pe[0].lu = peaces[j].lu;
						pe[0].rd.first = peaces[j].rd.first;
						pe[0].rd.second = peaces[j].lu.second + s;

						pe[1].lu.first = peaces[j].lu.first;
						pe[1].lu.second = s + peaces[j].lu.second;
						pe[1].rd = peaces[j].rd;
						newNumBase = i;
						erIdx = j;
						break;
					}
					else if(peaces[j].getWidhMergine() + peaces[j].getHightMergine() >= s){
						// ¡Éª
						// ã
						pe[0].lu = peaces[j].lu;
						pe[0].rd.first = s - peaces[j].getWidhMergine() + peaces[j].lu.first;
						pe[0].rd.second = peaces[j].rd.second;

						pe[1].lu.first = s - peaces[j].getWidhMergine() + peaces[j].lu.first;
						pe[1].lu.second = peaces[j].lu.second;
						pe[1].rd = peaces[j].rd;
						newNumBase = i;
						erIdx = j;
						break;
					}
					else if(peaces[j].getWidhMergine()*2 + peaces[j].getHightMergine() >= s){
						// cÉª
						pe[0].lu = peaces[j].lu;
						pe[0].rd.first = peaces[j].rd.first;
						pe[0].rd.second = peaces[j].rd.second - (-peaces[j].getHightMergine()-peaces[j].getWidhMergine() + s);
						
						pe[1].lu.first = peaces[j].lu.first;
						pe[1].lu.second = pe[0].rd.second;
						pe[1].rd = peaces[j].rd;
						newNumBase = i;
						erIdx = j;
						break;
					}
					else if((peaces[j].getWidhMergine() + peaces[j].getHightMergine())*2 >= s){
						// ¡Éª
						// ã
						pe[0].lu = peaces[j].lu;
						pe[0].rd.first = peaces[j].lu.first+(-s + 2*peaces[j].getWidhMergine() + 2*peaces[j].getHightMergine());
						pe[0].rd.second = peaces[j].rd.second;
						// º
						pe[1].lu.first = pe[0].rd.first;
						pe[1].lu.second = peaces[j].lu.second;
						pe[1].rd = peaces[j].rd;
						newNumBase = i;
						erIdx = j;
						break;
					}
				}
				
			}
			// Vµ­ÔðÂ¯é
			if(pe[0].getHightMergine() * pe[0].getWidhMergine() > pe[1].getHightMergine() * pe[1].getWidhMergine()){
				pe[0].num = newNumBase+2;
				pe[1].num = newNumBase+1;
			}
			else{
				pe[1].num = newNumBase+2;
				pe[0].num = newNumBase+1;
			}
			
			int erNum = peaces[erIdx].num;
			vector<peace>::iterator erit;
			for(vector<peace>::iterator it = peaces.begin(); it != peaces.end(); it++){
				if(it->num == erNum){
					erit = it;
					break;
				}
			}

			peaces.erase(erit);
			// ÔÌt¯Ö¦
			for(int k = 0; k < peaces.size(); k++){
				if(peaces[k].num > erNum){
					peaces[k].num--;
				}
			}
			peaces.push_back(pe[0]);
			peaces.push_back(pe[1]);
		}
		sort(peaces.begin(),peaces.end());
		for(int i = 0; i < peaces.size(); i++){
			cout << peaces[i].getHightMergine()*peaces[i].getWidhMergine();
			if(i == peaces.size() - 1)
				cout << endl;
			else
				cout << " ";
		}
	}

	return 0;
}

Measured memory_bytes: 0