#include <bits/stdc++.h>
#define rep(i, x, y) for (int i = x; i <= y; i++)
#define per(i, x, y) for (int i = x; i >= y; i--)
#define vi vector<int>
#define pb push_back
#define mkp make_pair
#define fi first
#define se second
#define gc getchar
#define db double
#define int long long
#define bs bitset
#define ll long long
#define ull unsigned long long
#define pii pair<int, int>
#define clr(x) memset(x, 0, sizeof(x))
#define lbit(x) ((x) & (-(x)))
#define Go(i, x, v) for (int i = 0, x = (i == v.size() ? 0 : v[i]); i < v.size(); i++, x = (i == v.size() ? 0 : v[i]))
using namespace std;
template <class T> void rd(T &x) {
  x = 0; char ch = gc(); int f = 1;
  for (; !isdigit(ch); ch = gc()) if (ch == '-') f = -1;
  for (; isdigit(ch); ch = gc()) x = (x << 1) + (x << 3) + ch - '0';
  x *= f;
}
template <class T> void cmin(T &x, T y) { x = min(x, y); }
template <class T> void cmax(T &x, T y) { x = max(x, y); }
const int mod = 1e9 + 7;
int add(int x, int y) { return x + y >= mod ? x + y - mod : x + y; }
int sub(int x, int y) { return x - y < 0 ? x - y + mod : x - y; }
int mul(int x, int y) { return 1ll * x * y % mod; }
void Add(int &x, int y) { x = (x + y >= mod ? x + y - mod : x + y); }
void Sub(int &x, int y) { x = (x - y < 0 ? x - y + mod : x - y); }
void Mul(int &x, int y) { x = 1ll * x * y % mod; }
int qpow(int a, int b) { int ret = 1; for (; b; b >>= 1, Mul(a, a)) if (b & 1) Mul(ret, a); return ret; }
/* ============ Header Template ============ */

const int N = 1e5 + 10;
int k, n, m, a[N], _l[N], _r[N], b[N];

bool chk(ll lim) {
  ll L = 0, R = 0;
  rep(i, 1, k) {
    ll l = max(0.0, ceil(1.0 * (m * a[i] - lim) / n)), r = (m * a[i] + lim) / n;
    if (l > r) return 0;
    L += l, R += r;
    _l[i] = l, _r[i] = r;
  }
  if (m < L || m > R) return 0;
  return 1;
}

signed main() {
  rd(k), rd(n), rd(m);
  rep(i, 1, k) {
    rd(a[i]);
  }
  ll l = 0, r = n * m, ans = r;
  while (l <= r) {
    ll mid = (l + r) >> 1;
    if (chk(mid)) ans = mid, r = mid - 1;
    else l = mid + 1;
  }
  chk(ans);
  rep(i, 1, k) {
    m -= _l[i];
    b[i] = _l[i];
  }
  rep(i, 1, k) {
    ll t = min(_r[i] - b[i], m);
    b[i] += t, m -= t;
    if (!m) break;
  }
  rep(i, 1, k) {
    printf("%lld ", b[i]);
  } puts("");
  return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define pii pair<ll,ll>
bool mycomp(pii a,pii b)
{
	if(a.first==b.first) return a.second>b.second;
	return a.first<b.first;
}
int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);	
	ll k,n,m,sum=0;
	cin>>k>>n>>m;
	ll a[k],b[k];
	vector<pii> sub,add;
	for(int i=0;i<k;i++)
	{
		cin>>a[i];
		a[i]*=m;
		b[i]=a[i];
		ll p=a[i]%n;
		ll q=n-p;
		sub.pb({p,i});
		add.pb({q,i});
	}
    sort(sub.begin(),sub.end(),greater<pii>());
    sort(add.begin(),add.end(),mycomp);
    int i=0,j=k-1;
    while(i<j){
    	if(add[i].first>sub[j].first){
    		b[sub[j].second]-=sub[j].first;
    		b[add[i].second]+=sub[j].first;
    		add[i].first-=sub[j].first;
    		j--;
		}
		else{
			b[add[i].second]+=add[i].first;
			b[sub[j].second]-=add[i].first;
			sub[j].first-=add[i].first;
			i++;
		}
	}
	for(int i=0;i<k;i++)
	cout<<(b[i]/n)<<" ";
}
