#include <bits/stdc++.h>
// #include <atcoder/all>
using namespace std;
// using namespace atcoder;
typedef long long ll;
const ll MOD = 1000000007;

#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define coutALL(x) for(auto i=x.begin();i!=--x.end();i++) cout<<*i<<" ";cout<<*--x.end()<<endl;
#define coutVEC2(x) rep(j, x.size()) {auto y=x.at(j); coutALL(y);}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main(){
	ll k,n,m,bsum=0;
	cin>>k>>n>>m;
	vector<ll> a(k), b(k);
	vector<pair<ll,ll>> rest;
	rep(i, k) cin>>a[i];

	rep(i, k) {
		a[i] *= m;
		b[i] = a[i]/n;
		bsum += b[i];
		rest.push_back({a[i]-b[i]*n, i});
	}
	// coutALL(b);
	sort(rest.begin(), rest.end(), greater<pair<ll,ll>>());
	// rep(i, k) cout<<rest[i].first<<" "<<rest[i].second<<endl;
	rep(i, m-bsum) b[rest[i].second]++;
	coutALL(b);

	return 0;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pii;
const int maxn=1e6+5;

int main() {
    ll k,n,m;cin>>k>>n>>m;
    vector<ll> a(maxn),b(maxn);
    vector<pii> lg,sm;
    for(int i=1;i<=k;i++) cin>>a[i];
    int left=m;
    for(int i=1;i<=k;i++) {
        b[i]=a[i]*m/n;
        if(abs((b[i]+1)*n-a[i]*m)>abs(b[i]*n-a[i]*m)) lg.push_back({abs((b[i]+1)*n-a[i]*m),i});
        else sm.push_back({b[i]*n-a[i]*m,i});
        left-=b[i];
    }
    sort(lg.begin(),lg.end());
    sort(sm.begin(),sm.end());
    for(int i=0;left&&i<sm.size();i++) {
        b[sm[i].second]++;left--;
    }
    for(int i=0;left&&i<lg.size();i++) {
        b[lg[i].second]++;left--;
    }
    for(int i=1;i<=k;i++) cout<<b[i]<<' ';cout<<endl;
    return 0;
}