// Aizu 1149: Cut the Cake
// 2017.9.18 bal4u@uu

#include <stdio.h>
#include <stdlib.h>

typedef struct { int no, w, d, s, f; } CK;
CK cake[110]; int len;

int cmp(CK *a, CK *b) {
	if (b->f - a->f) return b->f - a->f; 
	if (a->no - b->no) return a->no - b->no; 
	return a->s - b->s; 
}
int cmp2(CK *a, CK *b) { return a->s - b->s; }

int main()
{
	int n, w, d, p, s, i;
	CK *c, *n1, *n2;

	while (scanf("%d%d%d", &n, &w, &d) && w) {
		c = cake, c->no = 0, c->w = w, c->d = d, c->s = w*d, c->f = 1, len = 1;
		for (i = 1; i <= n; i++) {
			scanf("%d%d", &p, &s), c = cake + (p-1); n1 = cake + len++, n2 = cake + len++;
			s %= 2*(c->w + c->d);
			if (s < c->w) {
				n1->w =        s, n1->d = c->d;
				n2->w = c->w - s, n2->d = c->d;
				goto Done;
			}
			s -= c->w;
			if (s < c->d) {
				n1->w = c->w, n1->d =        s;
				n2->w = c->w, n2->d = c->d - s;
				goto Done;
			}
			s -= c->d;
			if (s < c->w) {
				n1->w = c->w - s, n1->d = c->d;
				n2->w =        s, n2->d = c->d;
				goto Done;
			}
			s -= c->w;
				n1->w = c->w, n1->d =        s;
				n2->w = c->w, n2->d = c->d - s;

Done:		n1->s = n1->w * n1->d, n1->f = 1;
			n2->s = n2->w * n2->d, n2->f = 1;
			if (n1->s < n2->s) n1->no = 2*i-1, n2->no = 2*i;
			else               n2->no = 2*i,   n1->no = 2*i;
			c->f = 0;
			qsort(cake, len, sizeof(CK), cmp), len--;
		}
		qsort(cake, len, sizeof(CK), cmp2);
		printf("%d", cake[0].s);
		for (i = 1; i < len; i++) printf(" %d", cake[i].s);
		printf("\n");
	}
	return 0;
}