from fractions import Fraction n,m=map(int,input().split()) w=list(map(int,input().split())) w_1=Fraction(str(sum(w)))/Fraction(str(m)) for i in range(n): w[i]=int(w[i]/w_1) print(*w)