#include<bits/stdc++.h>
#define ll long long int
#define mp make_pair
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define mii map<int,int>
#define mll map<long long int,long long int>
#define rep(it,m) for(auto it=m.begin();it!=m.end();it++)
#define pb push_back
#define fr first
#define sc second
#define mod 1000000007LL
#define setbiti(x) __builtin_popcount(x)
#define setbitll(x) __builtin_popcountll(x)
#define vi vector<int>
#define vll vector<long long int>
#define f(i,x,n) for(int i=x;i<n;i++)
#define l(i,a,b) for(int i=a;i>b;i--)
#define w(x) int x; cin>>x; while(x--)
#define all(x) x.begin(),x.end()
#define fill(a,x)  memset(a,x,sizeof(a))
#define pie 3.14159265
using namespace std;

void fio() {
/*#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif*/
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}


int main() {
    fio();
    ll k,n,m;
    cin>>k>>n>>m;
    vll vec(k);
    f(i,0,k){
      cin>>vec[i];
    }
    ll b[k]{0};
    ll cnt=0;
    vector<pll> diff;
    f(i,0,k){
        ll u=(m*vec[i])/n;
        b[i]=u;
        cnt+=u;
        ll d=abs(n*u-m*vec[i]);
        diff.pb(mp(d,i));
    }
    sort(all(diff));
    reverse(all(diff));
    cnt=m-cnt;
    f(i,0,k){
        if(cnt>0){
            b[diff[i].sc]++;
            cnt--;
        }
    }
    f(i,0,k){
        cout<<b[i]<<" ";
    }
    cout<<"\n";
    return 0;
}
#pragma GCC optimize ("Ofast,unroll-loops")
#pragma GCC optimize("no-stack-protector,fast-math")

#include <bits/stdc++.h>

using namespace std;

constexpr int N = 2e5+7;
constexpr int M = 1e9+7;

#define fastio ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define int long long
#define pii pair<int, int>
#define fi first
#define se second
#define SZ(x) ((int)(x.size()))

#ifdef int
#define INF 0x3f3f3f3f3f3f3f3f
#define INF2 (int)(0xcfcfcfcfcfcfcfcf)
#else
#define INF 0x3f3f3f3f
#define INF2 0xcfcfcfcf
#endif

inline int cdiv(int x, int y) {
    return (x + y - 1) / y;
}

signed main() {
    fastio
    int k, n, m;
    cin >> k >> n >> m;
    vector<int> a(k);
    vector<int> b(k);
    for (int& x: a) cin >> x;
    // x / ( n * m )
    auto check = [&](__int128 x) {
        vector<int> l(k+1, 0), r(k+1, 0);
        for (int j = 0; j < k ; j++) {
            int y = a[j];
            int L = cdiv(y * m - x, n);
            int R = (y * m + x ) / n;
            l[j+1] = l[j] + L, r[j+1] = r[j] + R;
        }
        int ans = m;
        for (int j = k-1; j >= 0; j--) {
            int y = a[j];
            int L = cdiv(y * m - x, n);
            int R = (y * m + x) / n;
            L = max(L, ans - r[j]), R = min(R, ans - l[j]);
            if (L > R) return false;
            b[j] = L;
            ans -= L;
        }
        return true;
    };

    int l = 0, r = m * n;
    while (l < r) {
        int mid = (l+r) >> 1;
        if (check(mid)) r = mid;
        else l = mid + 1;
    }
   // cout << (int)l << "/" << n*m << "\n";
    check(l);
    for (int x: b) cout << x << " ";
    cout << "\n";
    return 0;
}