// Undone
#include <bits/stdc++.h>
using namespace std;
signed main() {
  int N, W, D;
  while (cin>>N>>W>>D, N+W+D) {
    vector<pair<int, int>> v;
    v.push_back(make_pair(W, D));
    for (int i = 0; i < N; i++) {
      int p, s;
      cin>>p>>s;
      p--;
      int w = v[p].first, d = v[p].second;
      while (s > w*2+d*2) s -= w*2+d*2;
      pair<int,int> p1, p2;
      if (s < w) {
        p1 = make_pair(s, d);
        p2 = make_pair(w-s, d);
      } else if (s < w + d) {
        s -= w;
        p1 = make_pair(w, s);
        p2 = make_pair(w, d-s);
      } else if (s < 2*w+d) {
        s -= w+d;
        p1 = make_pair(s, d);
        p2 = make_pair(w-s, d);
      } else if (s < 2*w+2*d) {
        s -= 2*w+d;
        p1 = make_pair(w, s);
        p2 = make_pair(w, d-s);
      }
      v.erase(v.begin() + p);
      if (p1.first*p1.second > p2.first*p2.second) swap(p1, p2);
      v.push_back(p1);
      v.push_back(p2);
    }

    vector<int> ans(v.size());
    for (int i = 0; i < v.size(); i++) {
      ans[i] = v[i].first*v[i].second;
    }
    sort(ans.begin(), ans.end());
    for (int i = 0; i < v.size(); i++) {
      if (i) cout<<" ";
      cout << ans[i];
    }
    cout << endl;
  }
}


