import numpy as np N,Q=map(int,input().split()) a=list(map(int,input().split())) r=list(map(int,input().split())) b=[0]*N for p in r: b[(-p)%N]+=1 fft=np.fft L=len(a)+len(b)-1 c=list(map(int,fft.irfft(fft.rfft(a)*fft.rfft(b))+.5)) B=[0]*N for i in range(L): B[i%N]+=c[i] print(*B)