#include <bits/stdc++.h>

using namespace std;


int main() {
#ifndef LOCAL
    ios::sync_with_stdio(0);
    cin.tie(0);
#endif

    long long k, n, m;
    cin >> k >> n >> m;

    vector<int> arr(k);
    for (int &it : arr) {
        cin >> it;
    }

    int left = m;
    vector<int> brr(k);

    priority_queue<pair<long long, int>> pq;

    for (int i = 0; i < k; i++) {
        int b = (int)(arr[i] * m / n);
        left -= b;
        brr[i] = b;
        pq.push({-abs((b + 1) * n - arr[i] * m) + abs(b * n - arr[i] * m), i});
    }

    for (int i = 0; i < left; i++) {
        auto v = pq.top(); pq.pop();
        int j = v.second;
        brr[j]++;
        pq.push({-abs((brr[j] + 1) * n - arr[j] * m) + abs(brr[j] * n - arr[j] * m), j});
    }
    
    for (int it : brr) {
        cout << it << " ";
    }
    cout << '\n';
}

#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
using P = pair<int, int>;
using vec = vector<int>;
using mat = vector<vector<int>>;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define endl "\n"

constexpr int MOD = 1000000007;
constexpr int INF = 1001001001;

constexpr bool is_multiple = false;

i64 choose2(i64 n) {
    return n * (n-1);
}

void solve() {
    int k;
    cin >> k;
    string s, t;
    cin >> s >> t;

    int score_s = 0, score_tt = 0;
    map<int, int> map_s, map_tt;
    rep(i, 4) {
        map_s[s[i] - '0']++;
        map_tt[t[i] - '0']++;
    }

    long double rem = 9 * k - 8;

    long double res = 0;

    auto score_calc_s = [&](int i) {
        int ret = 0;

        map_s[i]++;

        for (int j = 1; j <= 9; j++) {
            int tmp = j;
            rep(_, map_s[j]) tmp *= 10;
            ret += tmp;
        }

        map_s[i]--;

        return ret;
    };

    auto score_calc_tt = [&](int i) {
        int ret = 0;

        map_tt[i]++;

        for (int j = 1; j <= 9; j++) {
            int tmp = j;
            rep(_, map_tt[j]) tmp *= 10;
            ret += tmp;
        }

        map_tt[i]--;

        return ret;
    };

    for (int i = 1; i <= 9; i++) {
        for (int j = 1; j <= 9; j++) {
            if (score_calc_s(i) > score_calc_tt(j)) {
                if (i != j) {
                    res += ((k - map_s[i] - map_tt[i]) / rem) * ((k - map_s[j] - map_tt[j]) / (rem - 1));
                }
                else {
                    res += ((k - map_s[i] - map_tt[i]) / rem) * (max(k - map_s[j] - map_tt[j] - 1, 0) / (rem - 1));
                }
            }
        }
    }

    cout << fixed << setprecision(10) << res << endl;
}

int main() {
    int t = 1;
    if (is_multiple) cin >> t;
    while (t--) solve();
    return 0;
}
