#include<stdio.h>

typedef struct CAKE{
	int w;
	int d;
}cake;



int main(void){
	int n,p,s;
	int i,j;
	cake piece[102];
	cake hoge;

	while(1){
		scanf("%d %d %d",&n,&piece[1].w,&piece[1].d);
		if(n==0&&piece[1].w==0&&piece[1].d==0){break;}

		for(i=1;i<n+1;i++){
			scanf("%d %d",&p,&s);
				
			if(s%(piece[p].w+piece[p].d)<piece[p].w){
				piece[i+1].w=(piece[p].w-(s%(piece[p].w+piece[p].d)));
				piece[i+1].d=piece[p].d;
	
				hoge.w=piece[p].w-piece[i+1].w;
				hoge.d=piece[p].d;
			}
	
			else{
				piece[i+1].w=piece[p].w;
				piece[i+1].d=(piece[p].d+piece[p].w-(s%(piece[p].w+piece[p].d)));
	
				hoge.w=piece[p].w;
				hoge.d=piece[p].d-piece[i+1].d;
			}
			
			for(j=p;j<=i-1;j++){
				piece[j]=piece[j+1];
			}
	
			if((hoge.w*hoge.d)>(piece[i+1].d*piece[i+1].w)){
				piece[i]=piece[i+1];
				piece[i+1]=hoge;
			}
			
			else{piece[i]=hoge;}

		}
	
		for(i=1;i<n+1;i++){
			for(j=1;j<n+1;j++){
				if((piece[j].w*piece[j].d)>(piece[j+1].d*piece[j+1].w)){
					hoge=piece[j];
					piece[j]=piece[j+1];
					piece[j+1]=hoge;
				}
			}
		}
	
		for(i=1;i<=n+1;i++){
			if(i==n+1){printf("%d\n",piece[i].d*piece[i].w);}
			else{printf("%d ",piece[i].d*piece[i].w);}
		}

	}
	return 0;
}