#include <bits/stdc++.h>
#define For(i, a, b) for(int (i)=(int)(a); (i)<(int)(b); ++(i))
#define rFor(i, a, b) for(int (i)=(int)(a)-1; (i)>=(int)(b); --(i))
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
#define fi first
#define se second
#define double long double
using namespace std;
typedef long long lint;
typedef unsigned long long ulint;
typedef pair<int, int> pii;
typedef pair<lint, lint> pll;
template<class T> bool chmax(T &a, const T &b){if(a<b){a=b; return true;} return false;}
template<class T> bool chmin(T &a, const T &b){if(a>b){a=b; return true;} return false;}
template<class T> T div_floor(T a, T b){
    if(b < 0) a *= -1, b *= -1;
    return a>=0 ? a/b : (a+1)/b-1;
}
template<class T> T div_ceil(T a, T b){
    if(b < 0) a *= -1, b *= -1;
    return a>0 ? (a-1)/b+1 : a/b;
}

constexpr lint mod = 1e9+7;
constexpr lint INF = mod * mod;
constexpr int MAX = 2000010;

int main(){
    int c, n, m;
    scanf("%d%d%d", &c, &n, &m);
    int s[n], p[n];
    rep(i, n) scanf("%d%d", &s[i], &p[i]);

    int dp[2][c+1];
    rep(i, 2)rep(j, c+1) dp[i][j] = -1;
    dp[0][0] = 0;
    rep(i, n){
        rep(j, c+1)if(dp[0][j] >= 0){
            chmax(dp[1][j], dp[0][j]);
            if(j+s[i] <= c) chmax(dp[1][j+s[i]], dp[0][j] + p[i]);
        }

        rep(j, c+1){
            dp[0][j] = dp[1][j];
            dp[1][j] = -1;
        }
    }

    rep(j, c) chmax(dp[0][j+1], dp[0][j]);
    For(i, 1, m+1) printf("%lld\n", (lint)dp[0][c/i] * i);
}
