#include <bits/stdc++.h>
using namespace std;

// #include <atcoder/all>
// using namespace atcoder;

#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll = long long;


void solve(long long K, long long N, long long M, std::vector<long long> A){
    vector<ll> B(K);
    ll used = 0;
    vector<pair<double, int>> ps;
    rep(i, K) {
        B[i] = A[i] * M / N;
        used += B[i];

        // (BN - AM) / NM を最小化する
        double cur = abs(1.0 * (B[i] * N - A[i] * M) / (N * M));
        // double updated = abs(1.0 * ((B[i] + 1) * N - A[i] * M) / (N * M));
        // ps.emplace_back(cur - updated, i);  // 下降が大きいものから
        ps.emplace_back(cur, i);  // 大きいものから
    }
    assert(used <= M);

    // for (ll e: B) {
    //     cout << e << " ";
    // }
    // cout << endl;

    sort(ps.rbegin(), ps.rend());
    rep(i, M - used) {
        B[ps[i].second]++;
    }
    for (ll e: B) {
        cout << e << " ";
    }
    cout << endl;

}

// Generated by 2.2.0 https://github.com/kyuridenamida/atcoder-tools
int main(){
    long long K;
    scanf("%lld",&K);
    long long N;
    scanf("%lld",&N);
    long long M;
    scanf("%lld",&M);
    std::vector<long long> A(K);
    for(int i = 0 ; i < K ; i++){
        scanf("%lld",&A[i]);
    }
    solve(K, N, M, std::move(A));
    return 0;
}

#include <bits/stdc++.h>

int main(){
    int K, N, M;
    std::cin >> K >> N >> M;
    std::vector< long long > A(K);
    for(int i=0; i<K; i++){
        std::cin >> A[i];
    }
    
    std::vector< long long > B(K);
    std::vector< std::pair< long long, long long > > B_zan_i(K);
    long long total = 0;
    for(int i=0; i<K; i++){
        B[i] = A[i] * M / N;
        total += B[i];
        B_zan_i[i].first = (A[i] * M) % N;
        B_zan_i[i].second = i;
    }
    
    std::sort(B_zan_i.begin(), B_zan_i.end());
    for(int i=0; i<M-total; i++){
        B[B_zan_i[K - i - 1].second]++;
    }
    
    for(int i=0; i<K; i++){
        if(i == K-1){
            std::cout << B[i] << std::endl;
        }else{
            std::cout << B[i] << " ";
        }
    }
    
    return 0;
}

