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