loop {
    n, w, d = gets.split.map &:to_i
    break if w == 0
    a = [nil, [w, d]]
    n.times { 
        i, s = gets.split.map &:to_i
        w, d = a.delete_at(i) 
        s %= (w + d)
        if s < w.to_f/2
            a += [[s, d], [w-s, d]]
        elsif s < w
            a += [[w-s, d], [s, d]]
        elsif s < w + d.to_f/2
            a += [[w, s-w], [w, d-s+w]]
        else
            a += [[w, d-s+w], [w, s-w]]
        end 
    }
    a.shift
    puts a.map{|w, d| w * d}.sort.join(" ")
}  