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