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