def cut(d, w, s):

    s %= 2 * (d + w)

    sq = []

    if 0 < s < w:

        sq = [(d, s), (d, w - s)]

    elif w < s < w + d:

        s -= w

        sq = [(s, w), (d - s, w)]

    elif w + d < s < 2 * w + d:

        s -= w + d

        sq = [(d, s), (d, w - s)]

    elif 2 * w + d < s < 2 * (w + d):

        s -= 2 * w + d

        sq = [(s, w), (d - s, w)]

    else:

        assert(False)

    p1, p2 = sq

    if p1[0] * p1[1] > p2[0] * p2[1]:

        p1, p2 = p2, p1

    return [p1, p2]





while True:

    N, W, D = list(map(int, input().split()))

    if not (N | W | D):

        break

    square = [(D, W)]

    for _ in range(N):

        p, s = list(map(int, input().split()))

        d, w = square.pop(p - 1)

        square.extend(cut(d, w, s))

    print((*sorted(d * w for d, w in square)))
def cut(d, w, s):

    s %= d + w

    sq = []

    if 0 < s < w:

        sq = [(d, s), (d, w - s)]

    elif w < s < w + d:

        s -= w

        sq = [(s, w), (d - s, w)]

    else:

        assert(False)

    p1, p2 = sq

    if p1[0] * p1[1] > p2[0] * p2[1]:

        p1, p2 = p2, p1

    return [p1, p2]





while True:

    N, W, D = list(map(int, input().split()))

    if not (N | W | D):

        break

    square = [(D, W)]

    for _ in range(N):

        p, s = list(map(int, input().split()))

        d, w = square.pop(p - 1)

        square.extend(cut(d, w, s))

    print((*sorted(d * w for d, w in square)))
def cut(d, w, s):
    s %= 2 * (d + w)
    sq = []
    if 0 < s < w:
        sq = [(d, s), (d, w - s)]
    elif w < s < w + d:
        s -= w
        sq = [(s, w), (d - s, w)]
    elif w + d < s < 2 * w + d:
        s -= w + d
        sq = [(d, s), (d, w - s)]
    elif 2 * w + d < s < 2 * (w + d):
        s -= 2 * w + d
        sq = [(s, w), (d - s, w)]
    else:
        assert False
    p1, p2 = sq
    if p1[0] * p1[1] > p2[0] * p2[1]:
        p1, p2 = p2, p1
    return [p1, p2]


while True:
    N, W, D = list(map(int, input().split()))
    if not (N | W | D):
        break
    square = [(D, W)]
    for _ in range(N):
        p, s = list(map(int, input().split()))
        d, w = square.pop(p - 1)
        square.extend(cut(d, w, s))
    print((*sorted(d * w for d, w in square)))

def cut(d, w, s):
    s %= d + w
    sq = []
    if 0 < s < w:
        sq = [(d, s), (d, w - s)]
    elif w < s < w + d:
        s -= w
        sq = [(s, w), (d - s, w)]
    else:
        assert False
    p1, p2 = sq
    if p1[0] * p1[1] > p2[0] * p2[1]:
        p1, p2 = p2, p1
    return [p1, p2]


while True:
    N, W, D = list(map(int, input().split()))
    if not (N | W | D):
        break
    square = [(D, W)]
    for _ in range(N):
        p, s = list(map(int, input().split()))
        d, w = square.pop(p - 1)
        square.extend(cut(d, w, s))
    print((*sorted(d * w for d, w in square)))

-    s %= 2 * (d + w) +    s %= d + w -        sq = [(s, w), (d - s, w)] -    elif w + d < s < 2 * w + d: -        s -= w + d -        sq = [(d, s), (d, w - s)] -    elif 2 * w + d < s < 2 * (w + d): -        s -= 2 * w + d