from fractions import Fraction n, m = map(int, input().split()) W = list(map(int, input().split())) if m == 0: print(*[0 for _ in range(n)]) exit() sumW = sum(W) w = Fraction(sumW, m) ans = [] for i in range(n): ans.append(int(Fraction(W[i], w))) print(*ans)