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