#include<iostream>
#include<algorithm>
using namespace std;
int N_MAX = 100000;
typedef long long ll;
typedef pair<ll,ll> P;
int main()
{
  ll k,n,m,i,a,s=0;
  ll b[N_MAX];
  P r[N_MAX];
  cin >> k >> n >> m;
  for(i=0;i<k;i++){
    cin >> a;
    b[i]=a*m/n;
    s+=b[i];
    r[i].first=(a*m)%n;
    r[i].second=i;
  }
  sort(r,r+k,greater<P>());
  for(i=0;i<m-s;i++)
    b[r[i].second]++;
  for(i=0;i<k;i++)
    cout << b[i] << " ";
  cout << endl;
  return 0;
}
#include <bits/stdc++.h>

using namespace std;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pf push_front
#define iter(v, i) for (__typeof__((v).begin()) i = (v).begin(); i != (v).end(); i++)
#define fast_io_without_cstdio ios_base::sync_with_stdio(false), cin.tie(NULL)
#define all(v) (v).begin(), (v).end()
#define rep(i, s, e) for (int i = s; i < e; i++)

// START for segment tree
#define params int p, int L, int R
#define housekeep int mid = (L + R) >> 1, left = p << 1, right = left | 1
// END

#ifdef __linux__
#define gc getchar_unlocked
#define pc putchar_unlocked
#else
#define gc getchar
#define pc putchar
#endif

#if __cplusplus <= 199711L
template<class BidirIt>
BidirIt prev(BidirIt it, typename iterator_traits<BidirIt>::difference_type n = 1) {
    advance(it, -n);
    return it;
}

template<class ForwardIt>
ForwardIt next(ForwardIt it, typename iterator_traits<ForwardIt>::difference_type n = 1) {
    advance(it, n);
    return it;
}
#endif

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef long double ldouble;

const double EPS = 1e-9;
const double PI = 3.141592653589793238462;

template<typename T>
inline T sq(T a) { return a * a; }

//#ifdef LOCAL_MACHINE
//#endif

const int MAXK = 1e5 + 5;

int k, n, m;
ll a[MAXK];

bool check(ll L, vector<ll> &b) {
    b.resize(k);
    ll cnt = m;
    for (int i = 0; i < k; i++) {
        b[i] = max(0LL, ( ll )ceil((a[i] * m - L) / ( ldouble )n));
        cnt -= b[i];
        //printf("before: b[%d] = %lld, cnt = %lld\n", i, b[i], cnt);
    }
    if (cnt < 0) return false;

    for (int i = 0; i < k; i++) {
        ll diff = (a[i] * m + L) / n - b[i];
        b[i] += min(diff, cnt);
        cnt -= min(diff, cnt);
        //printf("after: b[%d] = %lld, cnt = %lld\n", i, b[i], cnt);
        if (cnt == 0) break;
    }

    return (cnt == 0);
}

int main() {
    scanf("%d %d %d", &k, &n, &m);
    for (int i = 0; i < k; i++)
        scanf("%lld", &a[i]);

    ll lo = 0, hi = 1e18, who = -1;
    vector<ll> b, ans(k);

#if 1
    while (lo <= hi) {
        ll mid = (lo + hi) >> 1LL;
        if (check(mid, b)) {
            copy(all(b), ans.begin());
            who = mid;
            hi = mid - 1;
        } else {
            lo = mid + 1;
        }
    }
#else
    printf("check(3, b) = %d\n", check(3, b));
#endif

    //fprintf(stderr, "who = %lld\n", who);
    for (int i = 0; i < k; i++) {
        printf("%lld ", ans[i]);
    }
    puts("");
    return 0;
}
