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

typedef vector<long long> VL;

int main()
{
  long long K, N, M, A, B, count;
  cin >> K >> N >> M;
  count = M;
  priority_queue <VL> pque;
  VL now;
  for (int i = 0; i < K; i++)
  {
    cin >> A;
    B = A*M;
    B /= N;
    count -= B;
    pque.push(VL{A*M-B*N,B,i});
  }
  vector<long long> ans(K);
  while(!pque.empty())
  {
    now = pque.top();
    pque.pop();
    if (count > 0)
    {
      now.at(1)++;
      count--;
    }
    ans.at(now.at(2)) = now.at(1);
  }
  for (auto x : ans)
    cout << x << " ";
  cout << endl;
}

#include <bits/stdc++.h>
#define rep3(i, s, n, a) for (long long i = (s); i < (long long)(n); i += a)
#define rep2(i, s, n) rep3(i, s, n, 1)
#define rep(i, n) rep2(i, 0, n)
#define all(x) (x).begin(), (x).end()

using namespace std;
using ld = long double;
using ll = long long;
using ull = unsigned long long;
using P = pair<int, int>;
using Pll = pair<ll, ll>;

int main() { 
    ll k, n, m;
    cin >> k >> n >> m;
    vector<ll> a(k);
    a.resize(k, 0);
    for(auto &x: a) cin >> x;

    ll l = -1, r = (ll)1e18+1;
    // cout << -7074 / 10006 << endl;
    while(r-l>1){
        ll mid = (l+r) / 2LL;
        // cout << mid << endl;
        ll lsum = 0LL, rsum = 0LL;
        bool ok = true;
        rep(i, k){
            ll tmpr = (mid + a[i]*m) / n, tmpl = a[i]*m - mid;
            rsum += tmpr;
            if((a[i]*m-mid)%n){
                if(tmpl < 0){
                    tmpl /= n;
                    tmpl--;
                }else{
                    tmpl /= n;
                }
                lsum += max(0LL, tmpl + 1LL);
            }else{
                if(tmpl < 0){
                    tmpl /= n;
                    tmpl--;
                }else{
                    tmpl /= n;
                }
                lsum += max(0LL, tmpl);
            }
            // cout << lsum << " " << rsum << endl;
        }

        if(!ok){
            l = mid;
        }
        
        if(lsum <= m && m <= rsum){
            r = mid;
        }else{
            l = mid;
        }
    }
    ll upper = r;
    // cout << upper << endl;
    vector<ll> llim(k, 0), rlim(k, 0);
    ll mrem = m;
    rep(i, k){
        rlim[i] = (upper + a[i]*m) / n;
        ll tmpl = a[i]*m - upper;
        if((a[i]*m-upper)%n){
            if(tmpl < 0){
                tmpl /= n;
                tmpl--;
            }else{
                tmpl /= n;
            }
            llim[i] = max(0LL, tmpl + 1LL);
        }else{
            if(tmpl < 0){
                tmpl /= n;
                tmpl--;
            }else{
                tmpl /= n;
            }
            llim[i] = max(0LL, tmpl);
        }
        // if((a[i]*m-upper)%n){
        //     llim[i] = max(0LL, (a[i]*m - upper) / n + 1LL);
        // }else{
        //     llim[i] = max(0LL, (a[i]*m - upper) / n);
        // }
        mrem -= llim[i];
    }

    rep(i, k){
        ll out = min(rlim[i], mrem+llim[i]);
        cout << out << " ";
        mrem -= out - llim[i];
    }
    return 0;
}