#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std; //using namespace atcoder;
template<typename T>  using ve=vector<T>; 
using ll=long long; using ld=long double; using str=string; using pint=pair<ll,ll>;
using vll=ve<ll>; using vd=ve<ld>; using vs=ve<str>; using vll2=ve<ve<ll>>; 
#define whole(f,x,...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x)
#define b2e(v) v.begin(),v.end()
#define p2a(v, p) v[p.first][p.second]
#define rep(i,n)  for(ll i=0;i<(n);i++)
#define repi(i,n) for(ll i=(n-1);i>=0;i--)
#define repe(e,v) for(auto e:v)
const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;
const int MOD=1000000007;
//const int MOD=998244353;

ll divceil (ll x, ll div) { return (x/div) + (x%div>0); }
ll divfloor(ll x, ll div) { return (x/div) - (x%div<0); }
int main() {
    ll kn; cin >> kn;
    ll nn; cin >> nn;
    ll mn; cin >> mn;
    
    vll a1(kn);
    rep(i,kn) {
        ll x;
        cin >> x; a1[i]=x;
    }

    // 1. 剰余なしの値を設定B=(floor(MA/N))
    ll ct=0;
    vll b1(kn);
    ve<ld> lb1(kn, 0);
    rep(i,kn) {
        b1[i]  =divfloor(mn*a1[i],nn);
        if(a1[i]) lb1[i] =(ld)(mn*a1[i])/(ld)nn;
        ct+=b1[i];
    }
    
    // 2. 誤差とidxのpairの配列を作成(floorなしB-B)
    vector<pair<ld,ll>> vp1;
    rep(i,kn) {
        vp1.push_back({lb1[i]-(ld)b1[i],i});
    }
    
    // 3. 配列を誤差で降順ソート
    sort( vp1.begin(), vp1.end(), greater<pair<ld,ll>>() );

    // 4. 剰余分を更新
    rep(i,mn-ct) {
        b1[vp1[i].second]++;
    }

    rep(i,kn) {
        cout << b1[i] << " ";
    }
    cout << endl;
    
}

// B - Village of M People
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
#define rep(i,e) for(int i=0;i<(e);++i)

int main(){
	int k, n, m; cin>>k>>n>>m;
	vector<ll> B;
	vector<pair<ll,ll>> R;
	ll rest = m;
	rep(i, k){
		ll a; cin>>a;
		ll b = a*m / n;
		rest -= b;
		B.push_back(b);
		R.emplace_back(a*m % n, i);
	}
	sort(R.rbegin(), R.rend());
	rep(i, rest) B[R[i].second] += 1;
	rep(i, k) cout<< B[i] <<(i < k-1? " ":"\n");
}
