n, m = map(int, input().split()) w = list(map(int, input().split())) if m == 0: exit(print(*([0] * n))) s = sum(w) print(*[i * m // s for i in w])