constint N =1048576+10;constdouble pi =acos(-1);int n, m;structComplex{Complex(double xx =0,double yy =0){ x = xx, y = yy;}double x, y;
Complex operator+(Complex const&b)const{returnComplex(x + b.x, y + b.y);}
Complex operator-(Complex const&b)const{returnComplex(x - b.x, y - b.y);}
Complex operator*(Complex const&b)const{returnComplex(x*b.x - y*b.y, x*b.y + y*b.x);}
Complex operator/(Complex const&b)const{double t = b.x * b.x + b.y * b.y;returnComplex((x*b.x + y*b.y)/ t,(y*b.x - x*b.y)/ t);}} f[N<<1], g[N<<1];int tr[N<<1];voidFFT(Complex *f,bool flg){for(int i =0; i < n;++ i){if(i < tr[i]){swap(f[i], f[tr[i]]);}}for(int p =2; p <= n; p <<=1){int len = p >>1;
Complex tG(cos(2* pi / p),sin(2* pi / p));if(!flg) tG.y *=-1;for(int k =0; k < n; k += p){
Complex buf(1,0);for(int l = k; l < k + len;++ l){
Complex tmp = buf * f[len + l];
f[len + l]= f[l]- tmp;
f[l]= f[l]+ tmp;
buf = buf * tG;}}}}//F(x) = FL(x^2) + x * FR(x^2)//F(W^k) = FL(w^k) + W^k * FR(w^k)//F(W^{k+n/2}) = FL(w^k) - W^k * FR(w^k)voidsolve(){
n = rdi, m = rdi;for(int i =0; i <= n;++ i){scanf("%lf",&f[i].x);}for(int i =0; i <= m;++ i){scanf("%lf",&g[i].x);}for(m += n, n =1; n <= m; n <<=1);for(int i =0; i < n;++ i){
tr[i]=(tr[i>>1]>>1)|((i&1)? n>>1:0);}FFT(f,1);FFT(g,1);for(int i =0; i < n;++ i){
f[i]= f[i]* g[i];}FFT(f,0);for(int i =0; i <= m;++ i){write((int)(f[i].x / n +0.49));}}