#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); i++)
using namespace std;

int A[100000];
int64_t are[100000];
int main() {
	int K, N, M; cin >> K >> N >> M;
	int sum = 0;
	REP(i, K) {
		int64_t a; cin >> a;
		int64_t a2 = a * M;
		A[i] = a2 / N;
		are[i] = (a2 - A[i] * N) << 32 | i;
		sum += A[i];
	}
	nth_element(are, are + K - M + sum, are + K);
	for(int i = K - 1; i >= K - M + sum; i--) A[are[i] & (1 << 20) - 1]++;
	REP(i, K) cout << A[i] << " ";
	return 0;
}
#include<stdio.h>
#include<iostream>
#include<string>
#include<sstream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<tuple>
using namespace std;
int main(){
    long long k;
    long long n;
    long long m;
    long long a[200000];
    long long sum=0;
    long long kiriage=0;
    vector<pair<double,int>> vec;
    vector<pair<int,int>> vec2;
    cin >> k;
    cin >> n;
    cin >> m;
    for (int i = 0; i < k; i++){
        cin >> a[i];
//        vec.push_back({(double)((m*a[i]/n)-floorl((double)(m*a[i]/n))),(double)i});
        vec.push_back({(double)(-m*a[i]+n*floorl((double)(m*a[i]/n))),(double)i});
        vec2.push_back({i,floor((double)(m*a[i]/n))});
        sum+=floor((double)(m*a[i]/n));
    }
    kiriage=m-sum;
    sort(vec.begin(),vec.end());
    for(int i = 0; i < kiriage; i++){
        vec2.at(vec.at(i).second).second+=1;
    }
    sort(vec2.begin(),vec2.end());
    for (int i = 0; i < k; i++){
        cout << (vec2.at(i).second);
      	cout << " ";
    }

}