#include <iostream>
#include <stdio.h>
#include <climits>
#include <vector>
#include <queue>
#include <array>

//martin02

using namespace std;

int main() {
	long long int k, n, m;
	scanf("%lld %lld %lld", &k, &n, &m);
	vector<long long int> a(k);
	vector<long long int> b(k);
	priority_queue<array<long double, 2>> pq;
	for (int i = 0; i < k; i++) {
		scanf("%lld", &a.at(i));
	}

	long long int r = m;
	for (int i = 0; i < k; i++) {
		b.at(i) = (m * a.at(i)) / n;
		r -= b.at(i);
		pq.push({ (long double)a.at(i) / (long double)n - (long double)b.at(i) / (long double)m, (long double) i });
	}

	while (r != 0) {
		array<long double, 2> f = pq.top();
		pq.pop();
		b.at(f.at(1)) += 1;
		pq.push({ (long double)a.at(f.at(1)) / (long double)n - (long double)b.at(f.at(1)) / (long double)m, f.at(1) });
		r--;
	}

	for (int i = 0; i < k; i++) {
		printf("%lld ", b.at(i));
	}
	printf("\n");

	return 0;
}
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <chrono>
#define pb push_back
#define INF 0x3f3f3f3f
#define LINF 0x3f3f3f3f3f3f3f3f
#define endl '\n'
#define ll long long
#define f first
#define int long long
#define fin cin
#define fout cout
#define s second
#define FAST cin.tie(0), cout.tie(0), ios::sync_with_stdio(0)
#define debug(x) cout << "DEBUG " << x << endl
#define debug2(x, y) cout << "DEBUG " << x << " " << y << endl
#define debug3(x, y, z) cout << "DEBUG " << x << " " << y << " " << z<< endl
#define debug4(x, y, z, o) cout << "DEBUG " << x << " " << y << " " << z<< " " << o << endl
#define all(x) x.begin(), x.end()
#define left vadia
#define right puta
using namespace std;
void setIO(string s) {
  ios_base::sync_with_stdio(0); cin.tie(0);
  freopen((s+".in").c_str(),"r",stdin);
  freopen((s+".out").c_str(),"w",stdout);
}
typedef pair<ll, ll> pii;
typedef vector<vector<char>> mat;
typedef pair<int, string> pis;
const ll mod = 1e9+7;
const int MAXN = 1e4+5;
typedef vector<int> vi;
typedef pair<int, pair<int, int>> piii;


int32_t main() {
    int tot = 0, ans = 0, kek = 0;

    int n;
    cin >> n;

    vi v(n);

    for(int &i : v)
        cin >> i;

    for(int i = 2; i <= 1000; kek = 0, i++) {
        for(int &j : v) {
            kek += (j % i == 0);
        }
        if(kek > tot) tot = kek, ans = i;
    }
    cout << ans << endl;
}
