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