#include <bits/stdc++.h>

#define ll long long
#define map unordered_map
#define set unordered_set
#define l_l pair<ll, ll>
#define P pair<ll, ll>
#define vll vector<ll>
#define mll map<ll, ll>
#define mp make_pair
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define reps(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)
#define rev(i, n) for (int i = ((int)(n)-1); i >= 0; --i)
#define revs(i, n) for (int i = ((int)(n)); i > 0; --i)
// template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
// template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

using namespace std;

const ll MOD = 1000000007LL;
const ll INF = (1LL << 60LL);

// template <class T> void plus_mod(T &a, const T &b) {a = (a + b) % MOD;}

template <class T>
void join(vector<T> list) {
  rep(i, list.size()) {
    if (i >= 1) {
      cout << " ";
    }
    cout << (list[i]);
  }
  cout << ("") << endl;
}

int main() {
  // std::cout << std::fixed << std::setprecision(10);

  ll K, N, M;
  scanf("%lld %lld %lld", &K, &N, &M);

  ll ans = 0;

  vector<ll> alist;
  vector<ll> alist2;
  vll blist;

  vector<l_l> s_list;

  ll total = 0;

  rep(i, K) {
    ll v;
    scanf("%lld", &v);
    alist.emplace_back(v);
    alist2.emplace_back(v * M);

    ll n = v * M / N;
    blist.emplace_back(n);

    total += n;

    ll am = v * M % N;
    s_list.emplace_back(mp(am, i));
  }
  sort(s_list.begin(), s_list.end(), greater<P>());

  //
  // cout << ("==================") << endl;

  ll rest = M - total;

  // cout << "rest:" << (rest) << endl;

  rep(i, s_list.size()) {
    if (rest == 0) break;

    // auto s = s_list[i].first;
    auto index = s_list[i].second;

    blist[index]++;
    rest--;
  }

  join(blist);

  // cout << ans << endl;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> iint;
typedef pair<ll,ll> llll;
#define ALL(x) (x).begin(),(x).end()
const ll zero = 0;
const ll one = 1;
const ll INF = 9223372036854775807; //10^18
const int inINF = 2147483647; //10^9
const ll MOD = 1000000007; //10^9+7
const ll MOD2 = 998244353;
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

int main(){
    ll K, N, M;
    cin >> K >> N >> M;
    vector<int> A(K);
    for (int i = 0; i < K; i++) {
        cin >> A[i];
    }

    ll ok = 2e18+5;
    ll ng = -1;

    while(abs(ok-ng) > 1){
        ll mid = (ok+ng)/2;
        ll mi, ma;
        mi = 0; ma = 0;
        for (ll i = 0; i < K; i++) {
            if(A[i]*M - mid <= 0){
                mi += 0;
            }
            else{
                mi += (A[i]*M - mid + N-1) / N;
            }
            ma += min((mid + A[i]*M)/N, M);
        }
        if(mi <= M && M <= ma){
            ok = mid;
        }
        else{
            ng = mid;
        }
    }

    vector<ll> MI(K), MA(K);
    for (ll i = 0; i < K; i++) {
        if(A[i]*M - ok <= 0){
            MI[i] = 0;
        }
        else{
            MI[i] = (A[i]*M - ok + N-1) / N;
        }
        MA[i] = min((ok + A[i]*M)/N, M);
    }
    vector<ll> B(K);
    ll S = 0;
    for (ll i = 0; i < K; i++) {
        B[i] = MI[i];
        S += MI[i];
    }
    for (ll i = 0; i < K; i++) {
        if(M == S) break;
        B[i] += min(M - S, MA[i] - MI[i]);
        S += min(M - S, MA[i] - MI[i]);
    }
    for (ll i = 0; i < K; i++) {
        cout << B[i] << " ";
    }
    cout << endl;


}