#include <bits/stdc++.h>
#if __has_include(<atcoder/all>)
    #include <atcoder/all>
    using namespace atcoder;
#endif
using namespace std;

//#define int long long
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
typedef vector<vector<int>> graph;
#define pu push
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define MOD 1000000007
#define MAXX 1.1529215e+18
#define _1 first
#define _2 second
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
#define all(x) x.begin(),x.end()
#define si(x) int(x.size())

template<class t,class u> bool chmax(t&a,u b){if(a<b){a=b;return true;}else return false;}
template<class t,class u> bool chmin(t&a,u b){if(b<a){a=b;return true;}else return false;}
 
template<class t> using vc=vector<t>;

template<class T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }

template<class T>
T extgcd(T a, T b, T &x, T &y) {
    T d = a;
    if (b == 0) {
      x = 1;
      y = 0;
    } else {
      d = extgcd(b, a%b, y, x);
      y -= (a/b)*x;
    }
    return d;
}

template<class t,class u>
ostream& operator<<(ostream& os,const pair<t,u>& p){
	return os<<"{"<<p._1<<","<<p._2<<"}";
}
 
template<class t> ostream& operator<<(ostream& os,const vc<t>& v){
	os<<"{";
	for(auto e:v)os<<e<<",";
	return os<<"}";
}
 
template<class T>
void g(T &a){
	cin >> a;
}
template<class T>
void o(const T &a,bool space=false){
	cout << a << (space?' ':'\n');
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  int K;
  ll N, M;
  cin >> K >> N >> M;
  vector<ll> A(K);
  rep(i, K) {
    cin >> A[i];
  }
  ll l = 0;
  ll r = 2e9;
  while(r-l>1) {
      ll m = (l+r)/2;
      bool flag = true;
      ll sum1 = 0;
      ll sum2 = 0;
      rep(i, K) {
        ll t1 = (M*A[i]+m)/N;
        ll t2 = (M*A[i]-m+N-1)/N;
        sum1 += t1;
        sum2 += t2;
        if (t2 > t1) {
          flag = false;
        }
      }
      if (!(sum1 >= M && sum2 <= M))
        flag = false;
      if (flag) {
          r = m;
      } else {
          l = m;
      }
      // cout << m << endl;
  }
  // cout << r << ' ' << l << endl;
  vector<ll> v1(K);
  vector<ll> v2(K);
  int cnt = 0;
  rep(i, K) {
    v1[i] = (M*A[i]-r+N-1)/N;
    v2[i] = (M*A[i]+r)/N-(M*A[i]-r+N-1)/N;
    cnt += v1[i];
  }
  // cout << v1 << endl;
  // cout << v2 << endl;
  ll res = M-cnt;
  rep(i, K) {
    if (res < v2[i]) {
      v1[i] += res;
      res = 0;
    } else {
      v1[i]+= v2[i];
      res -= v2[i];
    }
  }
  // if (res > 0) {
  //   rep(i, K) {
  //     if (i < res % K) {
  //       v1[i] += res/K+1;
  //     } else {
  //       v1[i] += res/K;
  //     }
  //   }
  // }
  rep(i, K) {
    cout << v1[i] << ' ';
  }
  cout << endl;
}

#include <iostream>
#include <cmath>
#include <utility>
#include <vector>
#include <algorithm>

using namespace std;

#define mp make_pair
#define x first
#define y second
typedef pair<int,int> pii;
typedef long long ll;
typedef pair<ll,int> pl;

ll arr[100005],b[100005];
vector<pl> v;

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	int k;
	cin>>k;
	ll m,n;
	cin>>n>>m;
	for(int i=1;i<=k;i++){
		cin>>arr[i];
	}
	ll sum=0ll;
	for(int i=1;i<=k;i++){
		b[i]=arr[i]*m/n;
		sum+=b[i];
		v.push_back(mp(m*arr[i]-n*b[i],i));
	}
	sort(v.begin(),v.end());
	reverse(v.begin(),v.end());
	for(int i=sum;i<m;i++){
		b[v[i-sum].y]++;
	}
	for(int i=1;i<=k;i++) cout<<b[i]<<" ";
	




return 0;
}

