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