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

int main()
{
    ll k, n, m;
    cin >> k >> n >> m;

    vector<ll> a(k);
    for (int i = 0; i < k; i++)
    {
        cin >> a[i];
    }

    vector<ll> b(k);
    vector<pair<ll, ll>> d(k);
    ll sum = 0;
    for (int i = 0; i < k; i++)
    {
        b[i] = a[i] * m / n;
        d[i].first = a[i] * m % n;
        d[i].second = i;

        sum += b[i];
    }

    // a[i] * m % n が大きい順に1足す
    sort(d.begin(), d.end(), [](pair<ll, ll> a, pair<ll, ll> b) {
        return a.first > b.first;
    });
    const ll addNum = m - sum;

    for (ll i = 0; i < addNum; i++)
    {
        b[d[i].second]++;
    }

    for (auto const v : b)
    {
        cout << v << " ";
    }

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
#define INF 1000000010
#define EPS 1e-9
#define F first
#define S second

#define debug(x) cout<<x<<endl;
#define repi(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) repi(i,0,n)
#define lp(i,n) repi(i,0,n)
#define repn(i,n) for(int i=n;i>=0;i--)
#define int long long
#define endl "\n"

typedef pair<int,int> PII;
typedef pair<int,string> PIS;
typedef pair<string,int> PSI;

template <typename T>
bool chmax(T &a, const T& b) {
  if (a < b) {
    a = b; 
    return true;
  }
  return false;
}

template <typename T>
bool chmin(T &a, const T& b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}

signed main(){
  //cin.tie(0);	
  //ios::sync_with_stdio(false);
  int k,n,m;
  cin>>k>>n>>m;
  int a[k];
  rep(i,k){
    cin>>a[i];
    a[i]*=m;
  }
  int ans[k]={};
  int sum=0;
  priority_queue<PII> p;
  rep(i,k){
    ans[i]=((a[i]*2)+n)/(n*2);
    //cout<<ans[i]<<" "<<a[i]<<endl;
    sum+=ans[i];
    //cout<<sum<<endl;
    
  }
  //cout<<sum<<endl;
  if(sum<m){
    rep(i,k){
      p.push({((n+a[i]+((n)/2)))%n,i});
      //cout<<-((n+a[i]-((n+1)/2)))%n<<endl;
    }
    while(sum<m){
      PII now=p.top();
      p.pop();
      sum++;
      ans[now.S]++;
      now.F-=n;
      p.push(now);
    }
  }
  if(sum>m){
    rep(i,k){
      p.push({-(n+a[i]+((n)/2))%n,i});
      //cout<<(a[i]+(n/2))%n<<endl;
    }
    
    while(sum>m){
      PII now=p.top();
      p.pop();
      sum--;
      ans[now.S]--;
      now.F-=n;
      p.push(now);
    }
  }
  rep(i,k){
    if(i) cout<<" ";
    cout<<ans[i];
  }
  cout<<endl;

  return 0;
}
