#include <cmath>
#include <deque>
#include <algorithm>
#include <iterator>
#include <list>
#include <tuple>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <unordered_set>
#include <stack>
#include <string>
#include <vector>
#include <fstream>
#include <iostream>
#include <functional>
#include <numeric>
#include <iomanip> 
#include <stdio.h>
//eolibraries
#define lnf 3999999999999999999
#define inf 999999999
#define PI 3.14159265359
#define endl "\n"
#define fi first
#define se second
#define pb push_back
#define ll long long
#define all(c) (c).begin(),(c).end()
#define sz(c) (ll)(c).size()
#define mkp(a,b) make_pair(a,b)
#define make_unique(a) sort(all(a)),a.erase(unique(all(a)),a.end())
#define rsz(a,n) a.resize(n)
#define pii pair <ll,ll>
#define rep(i,n) for(ll i = 0 ; i < n ; i++) 
#define drep(i,n) for(ll i = n-1 ; i >= 0 ; i--)
#define crep(i,x,n) for(ll i = x ; i < n ; i++)
#define vi vector <ll> 
#define v(s) vector<s>
#define rsz(a,n) a.resize(n)
#define rszv(a,n,v) a.resize(n,v)
#define fcin ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
//eodefine

const ll max_n = 100000;

using namespace std;
ll k,n,m;
vi a;

bool ok(ll x) {
	ll lo = 0 , hi = 0;
	rep(i,k) {
		ll p2 = (a[i]*m + x) / n;
		ll p1 = (a[i]*m - x + n - 1) / n;
		p1 = max((ll)0,p1);
		hi+=p2;
		lo+=p1;
	}
	return lo <= m and m <= hi;
}

int main(){
fcin;
	cin >> k >> n >> m;
	
	a.resize(k,0);

	rep(i,k)cin>>a[i];
	
	ll l = 0 , r = 1e15 , c = 0;

	while(l <= r) {
		ll mid = (l+r)/2;

		if(ok(mid)) {
			c = mid;
			r = mid - 1;
		}else {
			l = mid + 1;
		}
	}	
	
	v(vi) candy;
	
	ll x = c;	
	rep(i,k) {
		ll p2 = (a[i]*m + x) / n;
		ll p1 = (a[i]*m - x + n - 1) / n;
		candy.pb({p1,p2});
	}

	ll s = 0;
	
	for(auto p : candy) s += p[0];

	ll need = m - s;

	rep(i,k) {
		ll em = candy[i][0];
		candy[i][0] = min(candy[i][1] , candy[i][0] + need);
		need -= candy[i][0] - em;
	}

	rep(i,k) cout << candy[i][0] << " ";
/*
*/

    return 0;   
}
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
//optimal subsequences-2 technocup round-3 2020
using namespace std;
using namespace __gnu_pbds;
const int N=2e5+10;
//#define d double
#define F first
#define S second
#define ll long long int
#define FastIO ios_base::sync_with_stdio(false),cin.tie(0)
#define fix std::fixed<<setprecision(6)
const int M=1e9+7;
//const int M=998244353;
#define f(n) for(int i=0;i<n;i++)
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define vi vector<int>
#define pb push_back
//#define si set<int>
#define cl(n,m) (ceil(double(n)/double(m)))
#define T() int t; cin>>t; while(t--)
#define pi pair<ll,ll>
//int MOD=998244353;
//const int MOD=1e9+7;
#define endl "\n"
const double PI = 3.141592653589793238460;
#define READ(f) freopen(f, "r", stdin)
#define WRITE(f) freopen(f, "w", stdout)

//ll d1=304933,d2=4395853;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

//bitset<N>bs;
//bitset<512>bb[512];
//vector<vector<int>>arr;
//#ifndef ONLINE_JUDGE
//freopen("input.txt", "r" , stdin);
//freopen("output.txt", "w", stdout);
//#endif

ll MOD;

ll power(ll a,ll b)
{
    ll res=1;
    if(a==1)return 1;
    for(;b>0;b>>=1)
    {
        if(b&1)res=(res*a);
        if(res>MOD)res%=MOD;
        a=(a*a);
        if(a>MOD)a=a%MOD;
    }
    return res;
}


bool isPrime[3000000+1];
vector<ll>prime;

vector<int>divisor;

void seive2(int limit)
{
    divisor=vector<int>(limit+1,0);

    for(int i=2;i<=limit;i++)
    {
        if(divisor[i]==0)
        {
            divisor[i]=i;
            if(i*1ll*i<=limit)
            for(int j=i*i;j<=limit;j+=i)divisor[j]=i;
        }
    }
}


void seive(int limit)
{
    isPrime[0]=isPrime[1]=1;

    for(int i=2;i*i<=limit;i++)
    {
        if(!isPrime[i])
        for(int j=i*i;j<=limit;j+=i)
        {
            isPrime[j]=1;
        }
    }
    for(int i=2;i<=limit;i++)if(!isPrime[i])prime.pb(i);
}

#define pii pair<ll,pi>
ll pt[200010],sz[200010],wt[200010];

int finds(int x)
{
    while(pt[x]!=x)
    {
        pt[x]=pt[pt[x]];
        x=pt[x];
    }
    return pt[x];
}

bool unions(int x,int y)
{
    int px=finds(x),py=finds(y);

    if(px==py)return 0;

    if(sz[px]>sz[py])swap(px,py);

    pt[px]=py;
    sz[py]+=sz[px];
    wt[py]+=wt[px];

    return 1;
}


ll bit[200100];

ll query(ll bit[],int x)
{
    ll ans=0;
    for(int i=x;i>0;i-=(i&(-i))){
        ans+=bit[i];
    }
    return ans;
}

void update(ll bit[],int x,ll val)
{
    for(int i=x;i>0;i-=(i&(-i)))
        bit[i]+=val;
}

void update2(ll bit[],int x,ll val)
{
    for(int i=x;i<=600005;i+=(i&(-i)))
        bit[i]+=val;
}


ll query2(ll sum[],int x)
{
    ll ans=0;
    for(int i=x;i<=200005;i+=(i&(-i)))
        ans+=sum[i];
    return ans;
}


void dfs(int s,vector<int>&v,vector<int>&P,int visited[])
{
    visited[s]=1;
    v.pb(s);

    int x=P[s];

    if(!visited[x])
    {
        dfs(x,v,P,visited);
    }
}

void solve()
{
    ll k,n,m;
    cin>>k>>n>>m;

    ll a[k+1];
    f(k)cin>>a[i+1];

    vector<ll>v;

    ll sum=0;

    f(k)
    {
        ll x=(a[i+1]*m+n-1)/n;
        v.pb(x);
        sum+=x;
    }

    set<pi>s;

    f(k)
    {
        ll b=v[i]-1;
        ll d=b*n-a[i+1]*m;
        s.insert({abs(d),i});
    }

    ll d=sum-m;

    while(d)
    {
        auto it=*s.begin();
        s.erase(it);

        int id=it.S;
        v[id]--;
        d--;
    }

    for(int x:v)cout<<x<<' ';

}

int main()
{
    //FastIO;

    int t=1;
//    cin>>t;

	for(int i=1;i<=t;i++)
    {
       // cout<<"Case #"<<i<<": ";
        solve();
        //if(i!=t)cout<<endl;
    }
	return 0;
}
