#include <bits/stdc++.h>
#define _overload3(_1,_2,_3,name,...)name
#define _rep(i,n)repi(i,0,n)
#define repi(i,a,b)for(int i=int(a),i##_len=(b);i<i##_len;++i)
#define MSVC_UNKO(x)x
#define rep(...)MSVC_UNKO(_overload3(__VA_ARGS__,repi,_rep,_rep)(__VA_ARGS__))
#define all(c)c.begin(),c.end()
#define write(x)cout<<(x)<<'\n'
using namespace std; using ll = long long; template<class T>using vv = vector<vector<T>>;
template<class T>auto vvec(int n, int m, T v) { return vv<T>(n, vector<T>(m, v)); }
constexpr int INF = 1 << 29, MOD = int(1e9) + 7; constexpr ll LINF = 1LL << 60;
struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(10); }; }aaaa;

int main() {
    int K, N, M;
    cin >> K >> N >> M;
    vector<int> A(K);
    rep(i, K) cin >> A[i];

    vector<ll> B(K);
    rep(i, K) {
        B[i] = (double)((ll)A[i] * M) / N;
    }

    ll Bsum = accumulate(all(B), 0LL);
    if (Bsum != M) {
        vector<pair<ll, int>> x(K);
        rep(i, K) {
            x[i] = { abs((ll)B[i] * N - (ll)A[i] * M), i };
        }
        sort(all(x));
        reverse(all(x));
        rep(i, K) {
            B[x[i].second]++;
            Bsum++;
            if (Bsum == M) break;
        }
    }
    rep(i, K) {
        cout << B[i] << (i == K - 1 ? "\n" : " ");
    }
}
#include <bits/stdc++.h>
using namespace std;

#ifdef LOCAL
#define DEBUG(...) debug(#__VA_ARGS__, __VA_ARGS__)
#else
#define DEBUG(...) 6
#endif

template<typename T, typename S> ostream& operator << (ostream &os, const pair<T, S> &p) {return os << "(" << p.first << ", " << p.second << ")";}
template<typename C, typename T = decay<decltype(*begin(declval<C>()))>, typename enable_if<!is_same<C, string>::value>::type* = nullptr>
ostream& operator << (ostream &os, const C &c) {bool f = true; os << "["; for (const auto &x : c) {if (!f) os << ", "; f = false; os << x;} return os << "]";}
template<typename T> void debug(string s, T x) {cerr << s << " = " << x << "\n";}
template <typename T, typename... Args> void debug(string s, T x, Args... args) {for (int i=0, b=0; i<(int)s.size(); i++) if (s[i] == '(' || s[i] == '{') b++; else
if (s[i] == ')' || s[i] == '}') b--; else if (s[i] == ',' && b == 0) {cerr << s.substr(0, i) << " = " << x << " | "; debug(s.substr(s.find_first_not_of(' ', i + 1)), args...); break;}}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

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

    long long l = 0, r = 2e18;
    while (l < r) {
        long long x = (l + r) / 2, lo = 0, hi = 0;
        for (int i=0; i<k; i++) {
            lo += (max(a[i] * m - x, 0LL) + n - 1) / n;
            hi += (a[i] * m + x) / n;
        }
        if (lo <= m && m <= hi)
            r = x;
        else
            l = x + 1;
    }

    vector<long long> lo(k), hi(k);
    for (int i=0; i<k; i++) {
        lo[i] = (max(a[i] * m - l, 0LL) + n - 1) / n;
        hi[i] = (a[i] * m + l) / n;
    }
    m -= accumulate(lo.begin(), lo.end(), 0LL);
    for (int i=0; i<k; i++) {
        long long change = min(m, hi[i] - lo[i]);
        lo[i] += change;
        m -= change;
        cout << lo[i] << " ";
    }
    cout << "\n";

    return 0;
}
