def knapsack(items, budget)
    table = (0..1).map{ Array.new(budget+1, 0) }
    for i in 0..items.size-1
        c, v = items[i]
        (0..c-1).each do |j|
            x = table[0][j]
            table[1][j] = x
        end
        (c..budget).each do |j|
            x = table[0][j]
            y = table[0][j-c] + v
            table[1][j] = x > y ? x : y
        end
        table << table.shift
    end
    table[0]
end

c, n, m = gets.split.map(&:to_i)
a = (1..n).map { gets.split.map(&:to_i) }
t = knapsack(a.map {|s, p| [s, p]}, c)
(1..m).each do |k|
    p t[c / k] * k
end


