N,M=map(int,input().split()) W=list(map(int,input().split())) S=sum(W) S=max(S,1) ANS=[W[i]*M//S for i in range(N)] print(*ANS)