#include <iostream>
#include <cstdlib>
#include <cstring>
#include <string>
#include <bitset>
#include <cmath>
#include <algorithm>
#include <climits>
#include <vector>
using namespace std;
typedef long long ll;

//infの設定
#define INF32 2147483647
#define INF64 9223372036854775807
//repマクロ
#define rep(i, m, n) for (int i = (m); (i) < (int)(n); ++ (i))

struct dataE{
    ll error;
    ll key;
};
bool cmp(const dataE &a, const dataE &b){
    return a.error>b.error;
}

int main(){
    ll K,N,M;
    cin>>K>>N>>M;

    vector<ll> A(101010),B(101010);

    vector<dataE> e(101010);

    ll sumB=0;
    rep(i,0,K){
        cin>>A.at(i);
        B.at(i)=A.at(i)*M/N;
        e.at(i).error=A.at(i)*M-B.at(i)*N;
        e.at(i).key=i;
        sumB+=B.at(i);
    }
    sort(e.begin(),e.end(),cmp);

    ll rem=M-sumB;
    rep(i,0,rem){
        B.at(e.at(i).key)++;
    }

    rep(i,0,K) cout<<B.at(i)<<" ";
    cout<<endl;

    return 0;
}
#include <iostream>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <string>
#include <sstream>
#include <algorithm>
#include <random>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <cassert>
#include <climits>
#include <bitset>
#include <functional>
#include <iomanip>
#include <random>

#define FOR_LT(i, beg, end) for (decltype(end) i = beg; i < end; i++)
#define FOR_LE(i, beg, end) for (decltype(end) i = beg; i <= end; i++)
#define FOR_DW(i, beg, end) for (decltype(beg) i = beg; end <= i; i--)
#define REP(n)              for (decltype(n) repeat_index = 0; repeat_index < n; repeat_index++)

using namespace std;

template<typename T, size_t S>
T minval(const T(&vals)[S])
{
	T val = numeric_limits<T>::max();
	FOR_LT(i, 0, S) {
		val = min(val, vals[i]);
	}
	return val;
}

template<typename T, size_t S>
T maxval(const T(&vals)[S])
{
	T val = numeric_limits<T>::min();
	FOR_LT(i, 0, S) {
		val = max(val, vals[i]);
	}
	return val;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout << fixed << setprecision(20);

	int64_t k, n, m; cin >> k >> n >> m;
	vector<int64_t> as(k); for (auto& a : as) { cin >> a; }

	vector<int64_t> bs(k);
	vector<int64_t> rs(k);

	int64_t sum = 0;
	FOR_LT(i, 0, k) {
		int64_t x = as[i] * m;
		bs[i] = x / n;
		rs[i] = x % n;
		sum += bs[i];
	}

	multimap<int64_t, int64_t> rmap;
	FOR_LT(i, 0, k) {
		rmap.insert({ rs[i], i });
	}

	{
		auto it = rmap.rbegin();
		while (it != rmap.rend()) {
			if (sum == m) break;
			bs[it->second]++;
			it++;
			sum++;
		}
	}

	FOR_LT(i, 0, k) {
		cout << bs[i] << " ";
	}
	cout << endl;

	return 0;
}