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

using namespace std;

#define rep(i, n) for(int i=0; i<(n); ++i)
#define all(c) (c).begin(), (c).end()

int prod(const pair<int, int>& p){return p.first * p.second;}

int main(){
    int n, w, d;
    while(cin >> n >> w >> d, n|w|d){
        vector<pair<int, int> > cake;
        cake.emplace_back(w, d);
        rep(_, n){
            int p, s;
            cin >> p >> s;
            p--;
            s %= (cake[p].first + cake[p].second);
            pair<int, int> a(cake[p]), b(cake[p]);
            if(s < cake[p].first)a.first = s, b.first -= s;
            else a.second = s-a.first, b.second -= s-b.first;
            if(b < a)swap(a, b);
            cake.insert(cake.end(), {a, b});
            cake.erase(cake.begin() + p);
        }
        sort(all(cake), [](const pair<int, int>& a, const pair<int, int>& b){return prod(a) < prod(b);});
        rep(i, n+1)cout << prod(cake[i]) << (i != n? ' ': '\n');
    }
    return 0;
}