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