// doot diddly donger cuckerino Hahahahahah


#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimize("unroll-loops")

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

using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using vi = vector<int>;

#define all(x)  (x).begin(), (x).end()
const ld PI = acos(-1);

template <typename T> inline T mini(T& x, T y) { return x = min(x, y); }
template <typename T> inline T maxi(T& x, T y) { return x = max(x, y); }
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
template <typename T, typename U>
std::ostream& operator<<(std::ostream& stream, const pair<T, U>& p) {
  return stream << p.first << " " << p.second;
}
template <typename T>
std::ostream& operator<<(std::ostream& out, const vector<T>& vec) {
  for (const T& x: vec) out << x << ' ';
  return out;
}
template <typename T>
std::istream& operator>>(std::istream& in, vector<T>& vec) {
  for (auto& x: vec) in >> x;
  return in;
}

class BVillageOfMPeople {
public:
  
  void solve() {
    int n, m, k;
    cin >> k >> n >> m;
    vector<long long> a(k);
    cin >> a;
    ll sum = 0;
    vector<long long> res;
    for (int i = 0; i < k; ++i) {
      ll val = abs(m * 1ll * a[i] / n);
      sum += val;
      res.push_back(val);
    }
    vector<pair<long long, int>> vec;
    for (int i = 0; i < k; ++i) {
      vec.emplace_back(a[i] * m % n, i);
    }
    sort(vec.rbegin(), vec.rend());
    for (int i = 0; i < m - sum; ++i) {
      res[vec[i].second]++;
    }
    cout << res << '\n';
  }
};

int32_t main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
	BVillageOfMPeople solver;
	
	
	solver.solve();
	return 0;
}

#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define vec vector
#define psb push_back
#define ppb pop_back
#define mkp make_pair
#define fst first
#define scd second
#define ins insert
#define psf push_front
#define ppf pop_front
using namespace std;
const ll maxk = 1e5;
ll n, m, k, a[maxk], b[maxk];
bool test(ll g) {
	//cout << g << "G\n";
	ll i, avail = m;
	for(i = 0; i < k; i++) {
		ll bmin = (a[i] - g + n - 1) / n;
		bmin = max(bmin, 0ll);
		//cout << bmin << " ";
		ll bmax = (a[i] + g) / n;
		if(bmin > bmax) {
			return false;
		}
		b[i] = bmin;
		avail -= b[i];
		if(avail < 0) {
			return false;
		}
	}
	for(i = 0; i < k && avail > 0; i++) {
		ll bmax = (a[i] + g) / n;
		if(bmax - b[i] <= avail) {
			avail -= (bmax - b[i]);
			b[i] = bmax;
		}
		else {
			b[i] += avail;
			avail = 0;
		}
	}
	return avail == 0;
	/*for(i = 0; i < k; i++) {
		bmin = (a[i] - g + n - 1) / n;
		bmax = a[i] / n;
		if(bmin <= bmax) {
			b[i] = bmin;
			avail -= bmin;
			if(avail < 0) {
				return false;
			}
		}
		else {
			bmin = (a[i] + n - 1) / n + (a[i] % n == 0);
			bmax = (a[i] + g) / n;
			if(bmin <= bmax) {
				b[i] = bmin;
				avail -= bmin;
				if(avail < 0) {
					return false;
				}
			}
			else {
				return false;
			}
		}
	}*/
}
int main() {
	ios_base :: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	
	cin >> k >> n >> m;
	for(ll i = 0; i < k; i++) {
		cin >> a[i];
		a[i] *= m;
	}
	
	ll high = 1e18, low = 0, mid;
	while(low < high) {
		mid = low + ((high-low) / 2);
		if(test(mid)) {
			//cout << "\ntrue "<<mid<<"\n";
			high = mid;
		}
		else {
			low = mid + 1;
		}
	}
	test(low);
	//cout << low << "\n";
	for(ll i = 0; i < k; i++) {
		cout << b[i] << " ";
	}
	return 0;
}