#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i, s, n) for (int i = (s); i < (n); ++i)
#define rrep(i, n) for (int i = n - 1; i >= 0; --i)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define len(x) (int)(x).size()
#define pb push_back
#define em emplace_back
#define vi vector<int>
#define vl vector<long long>
#define vs vector<string>
#define vc vector<char>
#define vd vector<double>
#define vb vector<bool>
#define vvi vector<vector<int>>
#define vvl vector<vector<long long>>
#define fast  \
  cin.tie(0); \
  ios::sync_with_stdio(false);
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;

vl a;
ll k, n, m;

// index が条件を満たすかどうか
bool isOK(ll index, ll key) {
  ll s = 0;
  rep(i, 0, k) {
    key -= (a[i] * m - index + n - 1) / n;
    if (key < 0) return false;
    s += (a[i] * m + index) / n - (a[i] * m - index + n - 1) / n;
  }
  if (key <= s) {
    return true;
  } else {
    return false;
  }
}

// 汎用的な二分探索のテンプレ
ll binary_search(ll key) {
  ll ng = -1;  //「index = 0」が条件を満たすこともあるので、初期値は -1
  ll ok = 10000000000000000;

  /* ok と ng のどちらが大きいかわからないことを考慮 */
  while (abs(ok - ng) > 1) {
    ll mid = (ok + ng) / 2;

    if (isOK(mid, key))
      ok = mid;
    else
      ng = mid;
  }
  return ok;
}

int main() {
  fast;
  cin >> k >> n >> m;
  a = vl(k);
  rep(i, 0, k) cin >> a[i];
  ll c = binary_search(m);
  vl ans(k), s(k);
  ll sum = 0;
  rep(i, 0, k) {
    ans[i] = (a[i] * m - c + n - 1) / n;
    sum += (a[i] * m - c + n - 1) / n;
    s[i] = (a[i] * m + c) / n - (a[i] * m - c + n - 1) / n;
  }
  rep(i, 0, k) {
    ans[i] += min(m - sum, s[i]);
    sum += min(m - sum, s[i]);
    if (sum == m) break;
  }
  for (auto i : ans) {
    cout << i << " ";
  }
  cout << endl;
  return 0;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
//const ll INF = numeric_limits<ll>::max() / 4;
//const int INF = numeric_limits<int>::max() / 4;


int main() {
	// ll N;
	ll K, N, M;
	cin >> K >> N >> M;
	vector<ll> A(K,0);
	for(int i = 0; i < K; i++) cin >> A[i];
	vector<ll> x(K,0);
	vector<ll> y(K,0);
	vector<ll> B(K,0);
	multimap<ll,ll> P;
	ll L = M;
	for(int i = 0; i < K; i++){
		x[i] = M * A[i] / N;
		B[i] = x[i];
		y[i] = M * A[i] % N;
		L -= x[i];
		P.insert(make_pair(N - y[i], i));
	}
	for(auto it = P.begin(); it != P.end(); it++){
		if(0 < L){
			B[it->second]++;
			L--;
		}else{
			break;
		}
	}
	for(int i = 0; i < K; i++){
		cout << B[i] << " ";
	}
	cout << endl;
	return(0);
}
