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