N, M = map(int, input().split()) W = list(map(int, input().split())) W = [w * M for w in W] SW = sum(W) c = SW // M ans = [w // c for w in W] print(*ans)