from numpy.fft import fft as F,ifft as G I=input I() a=I().split() b=[0]*len(a) for i in I().split():b[-int(i)]+=1 print(*map(int,G(F(a)*F(b))+.5))