#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define rep(i, n) for(int i = 0; i < n; i++)
#define all(x) (x).begin(),(x).end()

int main(){
    ll n,m,tot=0;
    cin >> n >> m;
    vector<ll> a(n);
    rep(i,n){
        cin >> a[i];
        tot += a[i];
    }
    if(!tot){
        rep(i,n) cout << 0 << " ";
        cout << endl;
        return 0;
    }
    rep(i,n) cout << m * a[i] / tot << " ";
    cout << endl;
    return 0;
}