from numpy.fft import* _,a,r=open(0) b=[0]*len(a:=a.split()) for i in r.split():b[-int(i)]+=1 print(*map(int,ifft(fft(a)*fft(b))+.5))