#include<stdio.h>
#include<stdlib.h>
typedef struct{
    int w;
    int h;
}Cake;
Cake cake[100];
int comp(const void *a,const void *b){
    Cake c=*(Cake *)a;
    Cake d=*(Cake *)b;
    if((c.w*c.h)<(d.w*d.h)) return -1;
    else return 1;
}
int main(void){
    while(1){
        int n,w,h;
        int s,p;
        scanf("%d%d%d",&n,&w,&h);
        if(n+w+h==0) break;
        cake[0].w=w; cake[0].h=h;
        for(int i=0;i<n;i++){
            scanf("%d%d",&p,&s);
            p=p-1;
            w=cake[p].w; h=cake[p].h;
            s=s%(w+h);
            //printf("p:%d s:%d\n",p,s);
            Cake small,big;
            if(s<w){
                if(s<=w/2){
                    small.w=s,small.h=cake[p].h;
                    big.w=cake[p].w-s,big.h=cake[p].h;
                }
                else{
                    small.w=cake[p].w-s,small.h=cake[p].h;
                    big.w=s,big.h=cake[p].h;
                }
            }
            else{
                s=s-w;
                if(s<=h/2){
                    small.w=cake[p].w,small.h=s;
                    big.w=cake[p].w,big.h=cake[p].h-s;
                }
                else{
                    small.w=cake[p].w,small.h=cake[p].h-s;
                    big.w=cake[p].w,big.h=s;
                }
            }
            //printf("w:%d h:%d\n",small.w,small.h);
            for(int j=p;j<i;j++){
                cake[j]=cake[j+1];
            }
            cake[i]=small; cake[i+1]=big;
        }
        qsort(cake,n+1,sizeof(Cake),comp);
        for(int i=0;i<n;i++) printf("%d ",cake[i].w*cake[i].h);
        printf("%d\n",cake[n].w*cake[n].h);
    }
}

