#include <algorithm>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstdio>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <sys/types.h>
#include <unistd.h>
#include <vector>

#pragma region macros
#define _overload(_1, _2, _3, name, ...) name
#define _rep(i, n) _range(i, 0, n)
#define _range(i, a, b) for (int i = int(a); i < int(b); ++i)
#define rep(...) _overload(__VA_ARGS__, _range, _rep, )(__VA_ARGS__)
#define _rrep(i, n) _rrange(i, n, 0)
#define _rrange(i, a, b) for (int i = int(a) - 1; i >= int(b); --i)
#define rrep(...) _overload(__VA_ARGS__, _rrange, _rrep, )(__VA_ARGS__)
#pragma endregion macros

using namespace std;

template <class T> bool chmax(T &a, const T &b) {
    return (a < b) ? (a = b, 1) : 0;
}
template <class T> bool chmin(T &a, const T &b) {
    return (b < a) ? (a = b, 1) : 0;
}

using ll    = long long;
using R     = long double;
const R EPS = 1e-9L;  // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R &r) {
    return (r > EPS) - (r < -EPS);
}
inline R sq(R x) {
    return sqrt(max(x, 0.0L));
}

const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

const pid_t pid = getpid();
// Problem Specific Parameter:

int main(void) {
    ll k, n, m;
    cin >> k >> n >> m;
    vector<ll> a(k);

    rep(i, k) {
        cin >> a[i];
    }

    vector<ll> b(k);
    rep(i, k) {
        b[i] = 1LL * a[i] * m / n;
    }

    ll rest = m;
    rep(i, k) {
        rest -= b[i];
    }

    vector<ll> zero(k);
    vector<ll> one(k);

    rep(i, k) {
        zero[i] = abs(b[i] * n - a[i] * m);
        one[i]  = abs((b[i] + 1) * n - a[i] * m);
    }

    ll low = 0LL, high = n + 1;
    while (high - low > 1) {
        const ll mid = (low + high) / 2LL;
        int f = 0, t = 0;
        bool ok = true;
        rep(i, k) {
            if (zero[i] <= mid and one[i] <= mid) {
                f += 0, t += 1;
            } else if (zero[i] <= mid) {
                f += 0, t += 0;
            } else if (one[i] <= mid) {
                f += 1, t += 1;
            } else {
                ok = false;
            }
        }

        if (ok and f <= rest and rest <= t) {
            high = mid;
        } else {
            low = mid;
        }
    }

    const ll thr = high;
    rep(i, k) {
        if (zero[i] > thr and one[i] <= thr) {
            b[i]++, rest--;
        }
    }

    rep(i, k) {
        if (rest > 0) {
            if (zero[i] <= thr and one[i] <= thr) {
                b[i]++, rest--;
            }
        }
    }

    rep(i, k) {
        cout << (i ? " " : "") << b[i];
    }
    cout << endl;

    return 0;
}
//#include <atcoder/maxflow.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
 

#include <iostream>
#include <map>
#include <list>
#include <set>
#include <algorithm>
#include <vector>
#include <string>
#include <functional>
#include <queue>
#include <deque>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <cmath>
#include <iterator>
#include <random>
#include <chrono>
#include <complex>
#include <bitset>
#include <fstream>
 
 
#define forr(i,start,count) for (int i = (start); i < (start)+(count); ++i)
#define set_map_includes(set, elt) (set.find((elt)) != set.end())
#define readint(i) int i; cin >> i
#define readll(i) ll i; cin >> i
#define readdouble(i) double i; cin >> i
#define readstring(s) string s; cin >> s

typedef long long ll;

 
//using namespace __gnu_pbds;
//using namespace atcoder;
using namespace std;

const ll modd = (1000LL * 1000LL * 1000LL + 7LL);
//const ll modd = 998244353;

int main(int argc, char *argv[])   {

    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    uniform_int_distribution<int> rand_gen(0, modd);   // rand_gen(rng) gets the rand no

    ios_base::sync_with_stdio(false);
    cin.tie(0);
 
    cout.precision(12);

//    readint(test_cases);
    int test_cases = 1;
    forr(t, 1, test_cases) {
        readint(n);
        vector<ll> a;
        ll summ = 0;
        forr(i,0,2*n) {
            readint(aa); a.push_back(aa);
            summ += aa;
        }
        priority_queue<ll> todo;
        ll comp = 0;
        forr(i,0,n) {
            todo.push(-a[n+i]);
            todo.push(-a[n-i-1]);
            comp += todo.top();
            todo.pop();
        }
        cout << summ+comp << endl;
    }

    return 0;
}
