#include<iostream>
#include<vector>
#include<tuple>
#include<algorithm>
using namespace std;

#define xsa (get<2>(*t)-get<0>(*t))
#define ysa (get<1>(*t)-get<3>(*t))

int main(){
    int n,w,d;
    int p[101], s[101];
    int i,j;

    //input
    cin >> n >> w >> d;
    while(d>0){
        for(i=0; i<n; i++){
            cin >> p[i] >> s[i];
        }

        //calc
        vector<tuple<int,int,int,int> > cakes;//leftup, rightdown.
        vector<tuple<int,int,int,int> >::iterator t,u;
        vector<int> menseki;

        //initial cake
        cakes.push_back(make_tuple(0,d,w,0));

        //cake cut
        for(i=0; i<n; i++){
            t = cakes.begin() + (p[i]-1);   
            s[i] = s[i] % (2*(xsa+ysa));

            //test
            
            if(s[i]<=xsa/2){
                cakes.push_back(make_tuple(get<0>(*t),get<1>(*t),get<0>(*t)+s[i],get<3>(*t)));
                u = cakes.begin() + (p[i]-1);
                t=cakes.end();
                --t;
                cakes.push_back(make_tuple(get<2>(*t),get<1>(*u),get<2>(*u),get<3>(*u)));
                u = cakes.begin() + (p[i]-1);
                cakes.erase(u);
            }else if(s[i]<=xsa){
                cakes.push_back(make_tuple(get<0>(*t)+s[i],get<1>(*t),get<2>(*t),get<3>(*t)));
                u = cakes.begin() + (p[i]-1);
                t=cakes.end();
                --t;
                cakes.push_back(make_tuple(get<0>(*u),get<1>(*u),get<0>(*t),get<3>(*u)));
                u = cakes.begin() + (p[i]-1);
                cakes.erase(u);
            }else if(s[i]<=xsa+ysa/2){
                cakes.push_back(make_tuple(get<0>(*t),get<1>(*t),get<2>(*t),get<1>(*t)-(s[i]-xsa)));
                u = cakes.begin() + (p[i]-1);
                t=cakes.end();
                --t;
                cakes.push_back(make_tuple(get<0>(*u),get<3>(*t),get<2>(*u),get<3>(*u)));
                u = cakes.begin() + (p[i]-1);
                cakes.erase(u);
            }else if(s[i]<=xsa+ysa){
                cakes.push_back(make_tuple(get<0>(*t),get<1>(*t)-(s[i]-xsa),get<2>(*t),get<3>(*t)));
                u = cakes.begin() + (p[i]-1);
                t=cakes.end();
                --t;
                cakes.push_back(make_tuple(get<0>(*u),get<1>(*u),get<2>(*u),get<1>(*t)));
                u = cakes.begin() + (p[i]-1);
                cakes.erase(u);
            }else if(s[i]<=xsa+xsa/2+ysa){
                cakes.push_back(make_tuple(get<2>(*t)-(s[i]-xsa-ysa),get<1>(*t),get<2>(*t),get<3>(*t)));
                u = cakes.begin() + (p[i]-1);
                t=cakes.end();
                --t;
                cakes.push_back(make_tuple(get<0>(*u),get<1>(*u),get<0>(*t),get<3>(*u)));
                u = cakes.begin() + (p[i]-1);
                cakes.erase(u);
            }else if(s[i]<=2*xsa+ysa){
                cakes.push_back(make_tuple(get<0>(*t),get<1>(*t),get<2>(*t)-(s[i]-xsa-ysa),get<3>(*t)));
                u = cakes.begin() + (p[i]-1);
                t=cakes.end();
                --t;
                cakes.push_back(make_tuple(get<2>(*t),get<1>(*u),get<2>(*u),get<3>(*u)));
                u = cakes.begin() + (p[i]-1);
                cakes.erase(u);
            }else if(s[i]<=2*xsa+ysa+ysa/2){
                cakes.push_back(make_tuple(get<0>(*t),get<3>(*t)+(s[i]-2*xsa-ysa),get<2>(*t),get<3>(*t)));
                u = cakes.begin() + (p[i]-1);
                t=cakes.end();
                --t;
                cakes.push_back(make_tuple(get<0>(*u),get<1>(*u),get<2>(*u),get<1>(*t)));
                u = cakes.begin() + (p[i]-1);
                cakes.erase(u);
            }else{
                cakes.push_back(make_tuple(get<0>(*t),get<1>(*t),get<2>(*t),get<3>(*t)+(s[i]-2*xsa-ysa)));
                u = cakes.begin() + (p[i]-1);
                t=cakes.end();
                --t;
                cakes.push_back(make_tuple(get<0>(*u),get<3>(*t),get<2>(*u),get<3>(*u)));
                u = cakes.begin() + (p[i]-1);
                cakes.erase(u);
            }
        }

        //menseki caputure
        for(t=cakes.begin(); t!=cakes.end(); ++t){
            menseki.push_back(xsa*ysa);
        }
        sort(menseki.begin(),menseki.end());

        //test

        //answer
        i=0;
        for(; i<menseki.size()-1; i++){
            cout << menseki[i] << " ";
        }
        cout << menseki[i] << endl;

        //input
        cin >> n >> w >> d;
    }
    return 0;   
}


Measured memory_bytes: 3116