N, M = map(int, input().split()) W = list(map(int, input().split())) S = sum(W) if M == 0: print(*[0]*N) exit() W = list(map(lambda x : x * M//S, W)) print(*W)