N, M = map(int, input().split())
W = list(map(int, input().split()))

ans = [0] * int(N)
if M == 0:
    print(*ans)
    exit()

sumW = sum(W)
for i in range(N):
    ans[i] = W[i] * M // sumW

print(*ans)