N,M = map(int, input().split()) W = list(map(int, input().split())) for i in range(N): W[i]=W[i]*10**20 S = sum(W) SM = S//M ANS = [] for i in range(N): ANS.append(W[i]//SM) print(*ANS)