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