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