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

using namespace std;

struct DATA{
  int w;
  int d;
};

DATA MakeOneData(int, int);
void Swap(int&, int&);
bool Compare(const DATA&, const DATA&);

int main(){
  int i, n, w, d, p, s, t;
  vector<DATA> data;

  while(1){
    cin >> n >> w >> d;
    if(n == 0 && w == 0 && d == 0) break;
    data.push_back(MakeOneData(w, d));

    for(i=0; i<n; ++i){
      cin >> p >> s;
      --p;
      w = data[p].w;
      d = data[p].d;
      s %= (w + d);
      data.erase(data.begin()+p);

      if(s < w){
	t = w-s;
	if(s > t) Swap(s, t);
	data.push_back(MakeOneData(s, d));
	data.push_back(MakeOneData(t, d));
      }else{
	s -= w;
	t = d-s;
	if(s > t) Swap(s, t);
	data.push_back(MakeOneData(w, s));
	data.push_back(MakeOneData(w, t));
      }
    }
    sort(data.begin(), data.end(), Compare);

    for(i=0; i<data.size()-1; ++i)
      cout << (data[i].d * data[i].w) << " ";
    cout << (data[data.size()-1].d * data[data.size()-1].w) << endl;

    data.clear();
  }
  return 0;
}

DATA MakeOneData(int w, int d){
  DATA data;
  data.w = w;
  data.d = d;
  return data;
}

void Swap(int& a, int& b){
  int c;
  c = a;
  a = b;
  b = c;
}

bool Compare(const DATA& x, const DATA& y){
  return ((x.d * x.w) < (y.d * y.w));
}