#define USE_CPP11
// #define USE_PRINTF

#include <iostream>
#include <iomanip>
#include <map>
#include <set>
#include <utility>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <numeric>
#include <complex>
#include <memory>
#include <sstream>

#ifdef USE_CPP11
#include <unordered_map>
#include <unordered_set>
#include <functional>
#endif

#define PRINT(obj) cout << obj << endl
#define REP(i, n) for(int (i) = 0; (i) < (n); i++)
#define SPACE " "

typedef long long ll;

using namespace std;

namespace Scanner {
#ifdef USE_PRINTF
  int    nextInt()    { int    d; scanf("%d" , &d); return d; }
  float  nextFloat()  { float  f; scanf("%f" , &f); return f; }
  double nextDouble() { double f; scanf("%lf", &f); return f; }  
  string nextString() { string s; scanf("%s" , &s); return s; }
  ll     nextll()     { ll     l; scanf("%ll", &l); return l; }
#else
  int    nextInt()    { int    d; cin >> d; return d; }
  float  nextFloat()  { float  f; cin >> f; return f; }
  double nextDouble() { double f; cin >> f; return f; }  
  string nextString() { string s; cin >> s; return s; }
  ll     nextll()     { ll     l; cin >> l; return l; }
#endif

  string getLine() { 
    string input;
    getline(cin, input);
    return input;
  }
};

namespace myLibrary {
  vector<string> split(const string& str, char delim) {
    vector<string> ret;
    size_t current = 0, found;
    while ((found = str.find_first_of(delim, current)) != string::npos) {
      ret.push_back(string(str, current, found - current));
      current = found + 1;
    }
    ret.push_back(string(str, current, str.size() - current));
    return ret;
  }
  
#ifdef USE_CPP11
  ///
  /// higher-order functional
  /// This is something like map in haskell, python, etc.
  /// Sample usage:
  ///   vector<int> a = {1, 2, 3, 4, 5};
  ///   vector<int> b = myLibrary::_Map<int, int>(a, [](int n){
  ///     return n * n;
  ///   });
  /// Result:
  ///   b = 1, 4, 9, 16, 25
  ///
  template<typename T_IN, typename T_OUT, class Functor>
  vector<T_OUT> _Map(vector<T_IN> src, Functor func) {
    vector<T_OUT> ret;
    for (int i = 0; i < src.size(); i++) {
      ret.push_back(func(src[i]));
    }
    return ret;
  }
#endif

};

/// BEGIN //////////////////////////////////////////////////////////

struct Cake {
public:
  int w, d;
  Cake() { }
  Cake(int w, int d): w(w), d(d) { }
  
  int getSquare() {
    return w * d;  
  }
  
  Cake operator= (const Cake& c) {
    this->w = c.w;
    this->d = c.d;
    
    return *this;
  }
};

struct State {
public:
  vector<Cake> c;
  
  State(int w, int d) {
    c.push_back(Cake(w, d));
  }
 
  void cut(int p, int s) {
    Cake cake = c[p];
    c.erase(c.begin() + p);
    
    Cake cut1, cut2;
    
    // ?????¨??\???????????????????????¨??\????????????
    s %= cake.w * 2 + cake.d * 2;
    
    if (s < cake.w) {
      // ??????    
      cut1 = Cake(s,          cake.d);
      cut2 = Cake(cake.w - s, cake.d);
    } else if (s - cake.w < cake.d) {
      // ??????
      s -= cake.w;
      cut1 = Cake(cake.w, s);
      cut2 = Cake(cake.w, cake.d - s);
    } else if (s - cake.w - cake.d < cake.w) {
      // ??????    
      s -= cake.w + cake.d;
      cut1 = Cake(cake.w - s, cake.d);
      cut2 = Cake(s,          cake.d);
    } else {
      // ??????
      s -= cake.w + cake.d + cake.w;
      cut1 = Cake(cake.w, cake.d - s);
      cut2 = Cake(cake.w, s);
    }
    
    // ??¢???????°??????????????????????????°???????
    if (cut1.getSquare() < cut2.getSquare()) {
      c.push_back(cut1);
      c.push_back(cut2);  
    } else {
      c.push_back(cut2);
      c.push_back(cut1);
    }
  }  
  
  void printAll() {
    sort(c.begin(), c.end(), [](Cake a, Cake b){
      return a.getSquare() < b.getSquare();
    });
    
    REP(i, c.size()) {
      cout << c[i].getSquare();
      if (i < c.size() - 1) {
        cout << SPACE;
      }
    }
    cout << endl;
  }
};



int main() {
  while (true) {
    int n = Scanner::nextInt();
    int w = Scanner::nextInt();
    int d = Scanner::nextInt();
    
    if (n + w + d == 0) break;
    
    State st(w, d);
    REP(i, n) {
      int p = Scanner::nextInt();
      int s = Scanner::nextInt();
      st.cut(p - 1, s);
    }  
    st.printAll();
  } 
  return 0;
}

/// END   //////////////////////////////////////////////////////////

Measured memory_bytes: 3092