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

ll solve() {
    ll K, N, M;
    cin >> K >> N >> M;
    vector<ll> A(K);
    for ( int i = 0; i < K; i++ ) cin >> A[i];
    ll INF = 1LL<<60;
    vector<ll> b1(K), b2(K);
    auto is_ok = [&](ll x) -> bool {
        ll b1s = 0, b2s = 0;
        for ( int i = 0; i < K; i++ ) {
            b1[i] = (A[i]*M-x+N-1) > 0 ? (A[i]*M-x+N-1)/N : 0;
            b2[i] = (A[i]*M+x)/N;
            if ( b1[i] > b2[i] ) return false;
            b1s += b1[i];
            b2s += b2[i];
            if ( b2s > INF ) return true;
        }
        return b1s <= M && M <= b2s;
    };

    ll l = 0, r = max(M,N)+10;
    while ( r-l > 1 ) {
        ll m = (r+l)/2;
        if ( is_ok(m) ) r = m;
        else l = m;
    }
    is_ok(r);
    vector<ll> b(b1);
    ll bs = 0;
    for ( int i = 0; i < K; i++ ) {
        bs += b1[i];
    }
    for ( int i = 0; i < K; i++ ) {
        if ( bs < M ) {
            ll d = min(b2[i]-b1[i], M-bs);
            b[i] += d;
            bs += d;
        }
    }
    for ( int i = 0; i < K; i++ ) {
        cout << (i != 0 ? " " : "") << b[i];
    }
    cout << "\n";
    return 0;
}

int main() {
    solve();
    return 0;
}
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <climits>
#include <vector>
#include <sstream>
#include <cstring>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <string.h>
#include <assert.h>
#include <iomanip>
#include <bitset>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ordered_set tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>
#define int long long
#define ull unsigned long long
#define F first
#define S second
#define nl "\n"
#define ld long double
#define sortv(v) sort(v.begin(),v.end())
#define rsortv(v) sort(v.rbegin(),v.rend())
#define div 1000000007
#define div2 998244353
#define PI 3.141592653589793
#define inf 1000000000000000000
#define blk 320
#define pb push_back


void solve()
{
    int k,n,m;cin>>k>>n>>m;
    int a[k],b[k];
    set<pair<int,int>> s;
    int sum=m;
    for(int i=0;i<k;i++)
    {
        cin>>a[i];
        b[i]=a[i]*m/n;
        s.insert({b[i]*n-a[i]*m,i});
        sum-=b[i];
    }
    while(sum>0)
    {
        auto it=*s.begin();
        int num=it.F,idx=it.S;
        b[idx]++;sum--;
        s.erase(*s.begin());
    }
    for(int i=0;i<k;i++)
        cout<<b[i]<<" ";
}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
        int t=1;
        //cin>>t;
        while(t--)
        {
            solve();
        }
}