#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
using ll = long long;
using pii = pair<int, int>;

int k, n, m;
vector<int> a;

bool isOK(ll x){
    vector<ll> l(k), r(k);
    ll ls = 0, rs = 0;
    rep(i,k){
        l[i] = (((ll)m*a[i] - x) + n - 1) / n;
        r[i] = ((ll)m*a[i] + x) / n;
        // if(l[i]>r[i]) return false;
        l[i] = max(l[i], 0ll);
        r[i] = min(r[i], (ll)m);
        ls += l[i];
        rs += r[i];
    }
    if (ls <= m && m <= rs) return true;
    return false;
}

void output(ll x){
    vector<ll> l(k), r(k);
    ll tot = 0;
    rep(i,k){
        l[i] = (((ll)m*a[i] - x) + n - 1) / n;
        r[i] = ((ll)m*a[i] + x) / n;
        tot += l[i];
    }
    rep(i,k){
        ll nb=l[i];
        if(tot < m){
            while(nb<r[i] && tot<m){
                nb++;
                tot++;
            }
        }
        cout << nb << " ";
    }
    cout << endl;
}

int main(){
    // int k, n, m;
    cin >> k >> n >> m;
    // vector<int> a(k);
    a.resize(k);
    rep (i,k) cin >> a[i];

    ll l=-1, r=(ll)n*m+1;
    while(l+1 < r){
        ll c = (l+r) / 2;
        if(isOK(c)) r = c;
        else l = c;        
    }
    output(r);
}
#include<bits/stdc++.h>
using namespace std;

int main(){
  long long k, n, m, bsum = 0;
  cin >> k >> n >> m;
  vector<long long> a(k), b(k);
  for(int i = 0; i < k; ++i){cin >> a[i];}

  for(int i = 0; i < k; ++i){b[i] = (m*a[i])/n; bsum += b[i];}
  vector<pair<long long, long long>> minsearch(k);
  for(long long i = 0; i < k; ++i){minsearch[i] = make_pair(n*b[i] - m*a[i], i);}
  sort(minsearch.begin(), minsearch.end());

  for(long long i = 0; i < m - bsum; ++i){
    b[minsearch[i].second] += 1;
  }

  for(int i = 0; i < k; ++i){cout << b[i] << " ";}cout << endl;
}