#include<bits/stdc++.h>
#define R register
#define ll long long
using namespace std;
const int MAXN = 1e5+5;
ll n,k,m,a[MAXN],b[MAXN],ans;
struct node
{
	int id;
	bool operator < (const node &x)const
	{
		return b[id]*n-m*a[id]>b[x.id]*n-m*a[x.id];
	}
};
bool check(ll x)
{
	ll tot=0;
	for(R int i=1;i<=k;++i)
	{
		ll num=m*a[i]-x;
		if(num<0) continue;
		{
			if(n*num/n>=num&&n*num/n<=num+2*x)
				tot+=num/n;
			else if(n*(num/n+1)>=num&&n*(num/n+1)<=num+2*x)
				tot+=num/n+1;
			else return false;
		}
	}
	return tot<=m;
}
void solve(ll x)
{
	ll tot=0;
	for(R int i=1;i<=k;++i)
	{
		ll num=m*a[i]-x;
		if(num<0) b[i]=0;
		else
		{
			if(n*num/n>=num&&n*num/n<=num+2*x)
				b[i]=num/n;
			else if(n*(num/n+1)>=num&&n*(num/n+1)<=num+2*x)
				b[i]=num/n+1;
		}
		tot+=b[i];
	}
	ll d=m-tot;
	for(R int i=1;i<=k;++i)
		b[i]+=d/k;
	d%=k;
	for(R int i=1;i<=k;++i)
	{
		if(!d) break;
		while(abs((b[i]+1)*n-m*a[i])<=ans)
		{
			--d;
			b[i]++;
		}
	}
	priority_queue <node> q;
	for(R int i=1;i<=k;++i) q.push(node{i});
	while(d--)
	{
		b[q.top().id]++;
		q.pop();
	}
	for(R int i=1;i<=k;++i)
		printf("%lld ",b[i]);
}
int main()
{
	scanf("%lld %lld %lld",&k,&n,&m);
	for(R int i=1;i<=k;++i) scanf("%d",&a[i]);
	ll l=0,r=n*m;
	ans=n*m;
	while(l<=r)
	{
		ll mid=l+r>>1;
		if(check(mid))
		{
			ans=mid;
			r=mid-1;
		}
		else l=mid+1;
	}
	solve(ans);
	return 0;
}
#include <bits/stdc++.h>
using namespace std;
typedef unsigned int ui;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
std::mt19937 rnd(time(0));
inline int sj(int n)
{
	unsigned int x=rnd();
	return x%n+1;
}
#define rand fst
template<typename typC> void read(register typC &x)
{
	register int c=getchar(),fh=1;
	while ((c<48)||(c>57))
	{
		if (c=='-') {c=getchar();fh=-1;break;}
		c=getchar();
	}
	x=c^48;c=getchar();
	while ((c>=48)&&(c<=57))
	{
		x=x*10+(c^48);
		c=getchar();
	}
	x*=fh;
}
template<typename typC, typename... Args> void read(typC &first, Args& ... args) {
	read(first);
	read(args...);
}
template<typename typC> void read(register typC *a,int num)
{
	for (register int i=1;i<=num;i++) read(a[i]);
}
template<typename typC> void write(register typC x)
{
	if (x<0) putchar('-'),x=-x;
	static int st[100];
	register int tp=1;
	register typC y;st[1]=x%10;x/=10;
	while (x) y=x/10,st[++tp]=x-y*10,x=y;++tp;
	while (--tp) putchar(st[tp]|48);
}
template<typename typC> void write(register typC *a,register int num)
{
	for (register int i=1;i<=num;i++) write(a[i]),putchar(i==num?10:32);
}
template<typename typC> typC ab(register typC x)
{
	if (x<0) return -x;
	return x;
}
#define space(x) write(x),putchar(32)
#define enter(x) write(x),putchar(10)
const int p=998244353;
const db eps=1e-9;
inline void inc(register int &x,const int y)
{
	if ((x+=y)>=p) x-=p;
}
inline void dec(register int &x,const int y)
{
	if ((x-=y)<0) x+=p;
}
inline int ksm(register int x,register int y)
{
	register int r=1;
	while (y)
	{
		if (y&1) r=(ll)r*x%p;
		x=(ll)x*x%p;
		y>>=1;
	}
	return r;
}
priority_queue<int> ONLYYFORRCOPYY;
priority_queue<int,vector<int>,greater<int> > ONLYYFORRCOPYY__;
struct Q
{
	int u,v;
	Q(int a=0,int b=0):u(a),v(b){}
	bool operator<(const Q &o) const {return v<o.v;}
};
typedef pair<ll,int> pa;
const int N=1e6+2,M=1e6+2,inf=1e9;
char s[N];
int a[N],b[N];
pa c[N];
int T,n,m,i,j,k,x,y,z,ans,la,ksiz,ks;
int main()
{
	//ios::sync_with_stdio(false);
	cout<<setiosflags(ios::fixed)<<setprecision(15);
	T=1;
	read(k,n,m);read(a,k);
	for (i=1;i<=k;i++) ans+=(b[i]=(ll)a[i]*m/n),c[i]=pa((ll)a[i]*m-(ll)b[i]*n,i);
	ans=m-ans;
	sort(c+1,c+k+1);reverse(c+1,c+k+1);
	for (i=1;i<=ans;i++) ++b[c[i].second];
	write(b,k);
}
