#
# 1149: Cut the Cakes
#

loop do
    n, w, h = gets.split.map(&:to_i)
    break if (n | w | h) == 0
    
    cakes = [[w, h]]
    
    n.times do
        pi, si = gets.split.map(&:to_i)
        pi -= 1
        
        wi, hi = cakes[pi]
        cakes.delete_at(pi)
        
        si %= wi + hi
        if si < wi 
            wi0 = si 
            wi1 = wi - wi0
            if wi0 < wi1
                cakes += [[wi0, hi], [wi1, hi]]
            else
                cakes += [[wi1, hi], [wi0, hi]]
            end
        else
            hi0 = hi - (wi - si)
            hi1 = hi -hi0
            if hi0 < hi1
                cakes += [[wi, hi0], [wi, hi1]]
            else
                cakes += [[wi, hi1], [wi, hi0]]
            end
        end
    end
    
    puts cakes.map{|wi, hi| wi * hi}.sort.join(' ')
end
    