#include <bits/stdc++.h>          
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repp(i, st, en) for (ll i = (ll)st; i < (ll)(en); i++)
#define repm(i, st, en) for (ll i = (ll)st; i >= (ll)(en); i--)
#define all(v) v.begin(), v.end()
void chmax(ll &x, ll y) {x = max(x,y);}
void chmin(ll &x, ll y) {x = min(x,y);}
void Yes() {cout << "Yes" << endl; exit(0);}
void No() {cout << "No" << endl; exit(0);}
template<class in_Cout> void Cout(in_Cout x) {cout << x << endl; exit(0);}
template<class in_vec_cout>
void vec_cout(vector<in_vec_cout> vec) {
    for (in_vec_cout res : vec) {cout << res << " ";}
    cout << endl;
}

const ll inf = 1e18;
const ll mod = 1e9 + 7;

ll K, N, M;
vector<ll> A, B;

void init() {
    cin >> K >> N >> M;
    A.resize(K);
    B.resize(K);
    rep(i,K) cin >> A[i];
}

/*
|N*B[i]-M*A[i]| <= X; (0 <= X <= N*M)
M*A[i] - X <= N*B[i] <= M*A[i] + X;
ceil((M*A[i]-X)/N) <= B[i] <= floor((M*A[i]+X)/N)
*/

ll Ceil(ll x, ll y) {
    if (y==0) return inf;
    if (x<=0) return 0;
    ll res = x / y;
    if (x%y) res++;
    return res;
}

ll Floor(ll x, ll y) {
    if (y==0) return inf;
    return x / y;
}

bool ok(ll X) {
    vector<ll> l(K), r(K);
    ll L = 0, R = 0;
    rep(i,K) {
        l[i] = Ceil(M*A[i]-X,N);
        r[i] = Floor(M*A[i]+X,N);
        L += l[i];
        R += r[i];
    }

    if (M<L || R<M) return false;

    ll dif = M - L;
    rep(i,K) {
        B[i] = l[i];
        ll add = min(dif,r[i]-l[i]);
        B[i] += add;
        dif -= add;
    }
    return true;
}

void solve() {
    init();

    ll l = -1, r = N*M + 1;
    while (r-l>1) {
        ll m = (l+r)/2;
        if (ok(m)) r = m;
        else l = m;
    }

    vec_cout(B);
}

int main() {
    solve();
}
#include <algorithm>
#include <iomanip>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <sstream>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <numeric>
#include <vector>
using namespace std;
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif
#define GET_MACRO(_1, _2, _3, NAME, ...) NAME
#define _rep(i, n) _rep2(i, 0, n)
#define _rep2(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(...) GET_MACRO(__VA_ARGS__, _rep2, _rep)(__VA_ARGS__)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
using i64 = long long;
template<class T, class U>
bool chmin(T& a, const U& b) { return (b < a) ? (a = b, true) : false; }
template<class T, class U>
bool chmax(T& a, const U& b) { return (b > a) ? (a = b, true) : false; }

template<typename T>istream& operator>>(istream&i,vector<T>&v){rep(j,v.size())i>>v[j];return i;}
template<typename T>string join(vector<T>&v){stringstream s;rep(i,v.size())s<<' '<<v[i];return s.str().substr(1);}
template<typename T>ostream& operator<<(ostream&o,vector<T>&v){if(v.size())o<<join(v);return o;}
template<typename T>string join(vector<vector<T>>&vv){string s="\n";rep(i,vv.size())s+=join(vv[i])+"\n";return s;}
template<typename T>ostream& operator<<(ostream&o,vector<vector<T>>&vv){if(vv.size())o<<join(vv);return o;}
template<class T> using pq = priority_queue<T, vector<T>, greater<T>>;

int main()
{
    int k, n, m;
    cin >> k >> n >> m;

    vector<long double> a(k);
    vector<int> b(k);
    vector<pair<long double, int>> p(k);
    
    cin >> a;

    rep(i, k) b[i] = (a[i] * m) / n + 0.001;

    int r = m - accumulate(all(b), 0);

    rep(i, k) 
    {
        p[i].first = b[i] - (a[i] * m) / n;
        p[i].second = i;
    }
    sort(all(p));

    rep(i, r)
    {
        b[p[i].second]++;
    }

    cout << b << endl;

    return 0;
}