#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
using ll = long long;
int main(){
    ll k,n,m;
    cin >> k >> n >> m;
    vector<ll> a(k);
    vector<ll> b(k);
    for(int i = 0;i < k;i++){
        cin >> a[i];
    }
    for(int i = 0;i < k;i++){
        b[i] = (m * a[i]) / n;
    }
    int sum_of_b = 0;
    for(int i = 0;i < k;i++){
        sum_of_b += b[i];
    }
    vector<pair<ll,int>> potential(k);
    for(int i = 0;i < k;i++){
        potential[i].first = abs(n * (b[i] + 1) - m * a[i]) - abs(n * b[i] - m * a[i]);
        potential[i].second = i;
    }
    sort(potential.begin(),potential.end(),[](pair<ll,int> a,pair<ll,int> b){return a.first < b.first;});
    for(int i = 0;i < m - sum_of_b;i++){
        b[potential[i].second] ++;
    }
    for(int i = 0;i < k;i++){
         cout << b[i] << ' ';
    }
    cout << endl;
    
    
    return 0;
}

#include<iostream>
#include<vector>
#include<algorithm>
//#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
#define ll long long
#define sort(a) sort(a.begin(),a.end())
#define reverse(a) reverse(a.begin(),a.end())
int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int K;
  ll N,M,count=0;
  cin>>K>>N>>M;
  vector<ll> A(K+10);
  vector<ll> C(K+10);
  vector<ll> D(K+10);
  vector<ll> E(K+10);
  for(int i=0;i<K;i++){
    int X;
    cin>>X;
    A[i]=M*X;
    C[i]=A[i]/N*N;
    count+=C[i]/N;
  }
  count=M-count;
  for(int i=0;i<K;i++){
    D[i]=abs(A[i]-C[i]);
    E[i]=D[i];
  }
  sort(D);
  reverse(D);
  for(int j=0;j<count;j++){
    for(int i=0;i<K;i++){
      if(D[j]==E[i]){
        C[i]+=N;
        E[i]=abs(E[i]-N);
        break;
      }
    }
  }
  for(int i=0;i<K;i++){
    cout<<C[i]/N<<" ";
  }
return 0;}
