#include<bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long k , n , m , a [100005];
vector < long long > v;
bool ck ( long double x )
{
    v . clear ();
    long double mm = m , nn = n;
    long long mnsum = 0 , mxsum = 0;
    for ( int i = 0 ; i < k ; i ++ )
    {
        long long mn = ceil ( ( mm * a [i] - x ) / nn ) , mx = ( mm * a [i] + x ) / nn;
        mnsum += mn , mxsum += mx;
    }
    for ( int i = 0 ; i < k ; i ++ )
    {
        if ( mnsum <= mm && mm <= mxsum )
        {
            long long mn = ceil ( ( m * a [i] - x ) / nn ) , mx = ( m * a [i] + x ) / nn;
            mnsum -= mn , mxsum -= mx;
            long long vmn = mm - mxsum , vmx = mm - mnsum;
            if ( mx < vmn || vmx < mn ) return 0;
            if ( mn <= vmn && vmn <= mx )
            {
                v . push_back ( vmn );
                mm -= vmn;
                continue;
            }
            if ( mn <= vmx && vmx <= mx )
            {
                v . push_back ( vmx );
                mm -= vmx;
                continue;
            }
            if ( vmn <= mn && mn <= vmx )
            {
                v . push_back ( mn );
                mm -= mn;
                continue;
            }
            if ( vmn <= mx && mx <= vmx )
            {
                v . push_back ( mx );
                mm -= mx;
                continue;
            }
        }
        else return 0;
    }
    return 1;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    cin >> k >> n >> m;
    for ( int i = 0 ; i < k ; i ++ ) cin >> a [i];
    long long l = 0 , r = 1e13 , mid;
    while ( l < r )
    {
        mid = ( l + r ) / 2;
        if ( ck ( mid ) ) r = mid;
        else l = mid + 1;
    }
    ck ( l );
    for ( int i = 0 ; i < v . size () ; i ++ ) cout << v [i] << ' ';
}

    #include "bits/stdc++.h"

    using namespace std;

    using ll = long long;
    using vll = vector<ll>;
    using vvll = vector<vector<ll>>;
    using vvvll = vector<vector<vector<ll>>>;
    using vvvvll = vector<vector<vector<vector<ll>>>>;
    using pl4 = pair<ll,ll>;
    using str = string;
    using vpl4 = vector<pair<ll,ll>>;

    #define sz size()
    #define be begin()
    #define en end()
    #define fi first
    #define se second
    #define pb push_back
    #define mp make_pair

    #define llin(x) ll (x);cin >>(x);
    #define stin(x) str (x);cin >>(x);
    #define vllin(x,n) vll (x)(n);FOR(i,0,n-1){cin >>(x)[i];}
    #define vllin2(a,b,n) vll (a)(n);vll (b)(n);FOR(i,0,n-1){cin >>(a)[i]>>(b)[i];}
    #define vllin3(a,b,c,n) vll (a)(n);vll (b)(n);vll (c)(n);FOR(i,0,n-1){cin >>(a)[i]>>(b)[i]>>(c)[i];}
    #define vlling(x,n) (x).assign(n,0);FOR(i,0,n-1){cin >>(x)[i];}
    #define vlling2(a,b,n) (a).assign(n,0);(b).assign(n,0);FOR(i,0,n-1){cin >>(a)[i]>>(b)[i];}
    #define vlling3(a,b,c,n) (a).assign(n,0);(b).assign(n,0);(c).assign(n,0);FOR(i,0,n-1){cin >>(a)[i]>>(b)[i]>>(c)[i];}
    #define vpl4in(x,n) vpl4 (x)((n),mp(0,0));FOR(i,0,n-1){cin >>x[i].fi>>x[i].se;}
    #define FOR(i,a,b) for(ll i = a ; i <= b ; i++)
    #define rFOR(i,b,a) for(ll i = a; i >= b ; i--)
    #define SORT(x) sort(x.be, x.en)
    #define rSORT(x) sort(x.rbegin(), x.rend())
    #define say(x) cout<<(x);
    #define sal(x) cout<<(x)<<endl;
    #define says(x) cout<<(x)<<(' ');
    #define sas cout<<(' ');
    #define sayR(x) cout<<fixed<<setprecision(10)<<(x);
    #define salR(x) cout<<fixed<<setprecision(10)<<(x)<<endl;
    #define yn(a) cout <<((a)?"yes":"no")<<endl;
    #define Yn(a) cout <<((a)?"Yes":"No")<<endl;
    #define YN(a) cout <<((a)?"YES":"NO")<<endl;
    #define Imp(a) cout <<((a)?"Possible":"Impossible")<<endl;
    #define IMP(a) cout <<((a)?"POSSIBLE":"IMPOSSIBLE")<<endl;
    #define pow(a,b) ll(pow(a,b))

    ll MOD=1000000007;
    ll INF=100000000000001;
    vector<ll> value; // ノードの値を持つ配列
    ll N;             // 葉の数
    
    void update(ll i, ll x) {
        // i 番目の葉の値を x に変える
        i += N - 1; // i 番目の葉のノード番号
        value[i] = x;
        while (i > 0) {
            i = (i - 1) / 2; // ノード i の親ノードの番号に変える
            value[i] = min(value[i * 2 + 1],
                        value[i * 2 + 2]); // 左右の子の min を計算しなおす
        }
    }
    
    ll query(ll a, ll b, ll k, ll l, ll r) {
        // [a, b) の区間に対するクエリについて
        // ノード k （区間 [l, r) 担当）が答える
        if (r <= a || b <= l) return INF; // 区間が被らない場合は INF を返す
        if (a <= l && r <= b)
            return value[k]; // ノード k の担当範囲がクエリ区間 [a, b)
                            // に完全に含まれる
        else {
            ll c1 = query(a, b, 2 * k + 1, l, (l + r) / 2); // 左の子に値を聞く
            ll c2 = query(a, b, 2 * k + 2, (l + r) / 2, r); // 右の子に値を聞く
            return min(c1, c2); // 左右の子の値の min を取る
        }
    }

    ll n;
    vvll d(200001,vll(2,0));
    vvll e(200001,vll(2,0));
    vvll a(200001,vll(2,0));
    vvll c(200001,vll(0));

long long mi(long long a) {
    ll m=MOD;
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

signed main(){
    llin(r1);
    llin(c1);
    llin(r2);
    llin(c2);
    ll x=abs(r1-r2);
    ll y=abs(c1-c2);
    if(x==0&&y==0){
        sal(0);
        return 0;
    }
    if(x-y==0||x+y<=3){
        sal(1);
        return 0;
    }
    if((x-y)%2==0||abs(x-y)<=3){
        sal(2);
        return 0;
    }
    sal(3);
}