N, M = map(int, input().split()) W = tuple(map(int, input().split())) S = sum(W) if S: ans = [round(w * M / S) for w in W] else: ans = [0] * N print(*ans)