n, m = map(int, input().split()) W = list(map(int, input().split())) tot = sum(W) if tot == 0: print(*W) else: print(*(w * m // tot for w in W))