def cut_at (x, y, len)
  xx, yy = 0, 0
  loop do
    [[x, 0], [0, y], [-x, 0], [0, -y]].each_with_index do |(dx, dy), i|
      if len - dx.abs - dy.abs < 0
        case i
        when 0
          return [xx + len, 0]
        when 1
          return [0, yy + len]
        when 2
          return [xx - len, 0]
        when 3
          return [0, yy - len]
        end
      end
      xx += dx; yy += dy
      len -= dx.abs + dy.abs
    end
  end
end

def calc_area(sx, sy, tx, ty)
  (ty - sy) * (tx - sx)
end

def cut(piece, i, len)
  sx, sy = piece[i - 1][0]
  tx, ty = piece[i - 1][1]
  x, y = tx - sx, ty - sy
  dx, dy = cut_at(x, y, len)
  nsx = sx + dx; nsy = sy + dy
  old = dx == 0 ? [[sx, sy], [tx, nsy]] : [[sx, sy], [nsx, ty]]
  now = dx == 0 ? [[sx, nsy], [tx, ty]] : [[nsx, sy], [tx, ty]]
  old_area = calc_area(old[0][0], old[0][1], old[1][0], old[1][1])
  now_area = calc_area(now[0][0], now[0][1], now[1][0], now[1][1])
  if old_area <= now_area
    piece[i - 1] = old
    piece << now
  else
    piece[i - 1] = now
    piece << old
  end
end

loop do
  n, w, d = gets.split.map(&:to_i)
  break if n == 0 && w == 0 && d == 0
  piece = []
  piece << [[0, 0], [w, d]]
  n.times.each do
    i, len = gets.split.map(&:to_i)
    cut(piece, i, len)
  end
  puts piece.map{ |(sx, sy), (tx, ty)|
    calc_area(sx, sy, tx, ty)
  }.sort.join(' ')
end