#include <cstdio>
#include <algorithm>
#include <utility>
#include <vector>

#define N 128

using namespace std;

/** Application main entry point. */
int
main (
  int     argc,
  char  * argv[ ]
  )
{
  int i;

  for ( ; ; )
  {
    typedef pair<int, int> Point;
    vector<int>   ans;
    vector<Point> lis;
    int n, w, d;

    scanf ( "%d%d%d", &n, &w, &d );
    if ( !( n | w | d ) ) break ;
    lis.push_back ( make_pair ( w, d ) );

    for ( i = 0; i < n; ++i )
    {
      Point tg;
      int p, s;

      scanf ( "%d%d", &p, &s );
      tg = lis[ p - 1 ];
      lis.erase ( lis.begin ( ) + p - 1 );

      s %= ( tg.first + tg.second );
      if ( s > tg.first )
      {
        s -= tg.first;
        lis.push_back ( make_pair ( tg.first, min ( s, tg.second - s ) ) );
        lis.push_back ( make_pair ( tg.first, max ( s, tg.second - s ) ) );
      }
      else
      {
        lis.push_back ( make_pair ( min ( s, tg.first - s ), tg.second ) );
        lis.push_back ( make_pair ( max ( s, tg.first - s ), tg.second ) );
      }
    }

    for ( vector<Point>::iterator it = lis.begin ( )
        ; it != lis.end ( ); ++it )
    {
      ans.push_back ( it->first * it->second );
    }
    sort ( ans.begin ( ), ans.end ( ) );

    for ( vector<int>::iterator it = ans.begin ( )
        ; it != ans.end ( ); ++it )
    {
      if ( it != ans.begin ( ) )  putchar ( ' ' );
      printf ( "%d", *it );
    }
    puts ( "" );
  }

  return ( 0 );
}