/*** author: yuji9511 ***/
#include <bits/stdc++.h>
// #include <atcoder/all>
// using namespace atcoder;
using namespace std;
using ll = long long;
using lpair = pair<ll, ll>;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i=(m);i<(n);i++)
#define rrep(i,m,n) for(ll i=(m);i>=(n);i--)
#define printa(x,n) for(ll i=0;i<n;i++){cout<<(x[i])<<" \n"[i==n-1];};
void print() {}
template <class H,class... T>
void print(H&& h, T&&... t){cout<<h<<" \n"[sizeof...(t)==0];print(forward<T>(t)...);}
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << "\n"

void solve(){
    ll n,a,b;
    cin >> n >> a >> b;
    print(n-a+b);

}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
}
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define pb push_back()
#define ff first
#define ss second
#define MOD 1000000007
int32_t main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int t = 1;
	// cin >> t;
	while (t--) {
		int k, n, m;
		cin >> k >> n >> m;
		int ans[k];
		int a[k];
		int sum = 0;
		for (int i = 0; i < k; i++) {
			cin >> a[i];
			ans[i] = m * a[i] / n;
			sum += ans[i];
		}
		sum = m - sum;
		pair<int, int> diff[k];
		for (int i = 0; i < k; i++) {
			diff[i].ff = abs((ans[i] + 1) * n - a[i] * m);
			diff[i].ss = i;
		}
		sort(diff, diff + k);
		for (int i = 0; i < sum; i++) {
			ans[diff[i].ss]++;
		}
		for (int i = 0; i < k; i++) {
			cout << ans[i] << " ";
		}
		cout << endl;
	}
}