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