#include <bits/stdc++.h>
using namespace std;

#define N	100001
#define L	18	/* L = ceil(log2(N * 2 - 1)) */
#define N_	(1 << L)
#define MD	469762049	/* MD = 56 * 2^23 + 1 */

int *wu[L + 1], *wv[L + 1];

int power(int a, int k) {
	long long b = a, p = 1;

	while (k) {
		if (k & 1)
			p = p * b % MD;
		b = b * b % MD;
		k >>= 1;
	}
	return p;
}

void init() {
	int l, i, u, v;

	/* u ^ n must be equal to 1 for FFT */
	/* since x ^ (MD - 1) = 1 (mod MD) by fermat's little theorem */
	/* so MD - 1 must be power of 2 as n is a power of 2 */
	u = power(3, (MD - 1) >> L);
	
	/* v is u ^ -1 = u ^ (MD - 2) by fermat's little theorem */
	/* this is for interpolation (inverse FFT) */
	v = power(u, MD - 2);
	
	/* find the powers of u and v for each possible n */
	for (l = L; l > 0; l--) {
		int n = 1 << (l - 1);

		wu[l] = (int *) malloc(n * sizeof *wu[l]);
		wv[l] = (int *) malloc(n * sizeof *wv[l]);

		wu[l][0] = wv[l][0] = 1;
		for (i = 1; i < n; i++) {
			wu[l][i] = (long long) wu[l][i - 1] * u % MD;
			wv[l][i] = (long long) wv[l][i - 1] * v % MD;
		}
		
		/* change u and for next iteration of n, which becomes n / 2 */
		/* u ^ n = 1 => (u ^ (n / 2)) ^ 2 = 1 */
		/* same goes for v */
		u = (long long) u * u % MD, v = (long long) v * v % MD;
	}

}

void ntt_(int *aa, int l, int inverse) {
	if (l > 0) {
		int n = 1 << l;
		int m = n >> 1;
		int *ww = inverse ? wv[l] : wu[l];
 		int i, j;

 		/* solve for even and odd degrees */
 		/* P(x) = P_even(x) + x * P_odd(x) */
 		/* where P_even(x) is the terms with even degree and */
 		/* where P_odd(x) is the terms with odd degree and */
		ntt_(aa, l - 1, inverse);
		ntt_(aa + m, l - 1, inverse);

		/* now we make the point value form */
		for (i = 0; (j = i + m) < n; i++) {

			/* a is even degree */
			/* b is odd degree, multiply by root^i */
			/* because we need to multiply back the part from */
			/* splitting P(x) into P_even(x) + x * P_odd(x) with x = root^i */
			int a = aa[i];
			int b = (long long) aa[j] * ww[i] % MD;
 	
 			/* even part is all positive for all x of x ^ y */
 			/* odd part is positive for x ^ y such that x is positive (first case, even index) */
 			/* otherwise negative for negative x (second case, odd index) */
			if ((aa[i] = a + b) >= MD)
				aa[i] -= MD;
			if ((aa[j] = a - b) < 0)
				aa[j] += MD;
		}
	}
}

void ntt(int *aa, int l, int inverse) {
	int n_ = 1 << l, i, j;

	/* reverse the bits for each element so that */
	/* in the FFT we don't have to split the even/odd indexes */
	/* as it becomes into two ranges: [l, m) and [m, r) */
	for (i = 0, j = 1; j < n_; j++) {
		int b;
		int tmp;
 
		for (b = n_ >> 1; (i ^= b) < b; b >>= 1)
			;
		if (i < j)
			tmp = aa[i], aa[i] = aa[j], aa[j] = tmp;
	}
	ntt_(aa, l, inverse);
}

void mult(int *aa, int n, int *bb, int m, int *out) {
	static int aa_[N_], bb_[N_];
	int l, n_, i, v;

	/* enlarge size so that it's a power of 2 */
	l = 0;
	while (1 << l <= n - 1 + m - 1)
		l++;
	n_ = 1 << l;
	memcpy(aa_, aa, n * sizeof *aa), memset(aa_ + n, 0, (n_ - n) * sizeof *aa_);
	memcpy(bb_, bb, m * sizeof *bb), memset(bb_ + m, 0, (n_ - m) * sizeof *bb_);
	
	/* FFT: convert coefficient form to point value form */
	ntt(aa_, l, 0), ntt(bb_, l,  0);

	/* combine point value forms */
	for (i = 0; i < n_; i++)
		out[i] = (long long) aa_[i] * bb_[i] % MD;
	
	/* Inverse FFT: convert point value form to coefficient form */
	ntt(out, l, 1);
	v = power(n_, MD - 2);
	for (i = 0; i < n_; i++)
		out[i] = (long long) out[i] * v % MD;
}

int main() {
	static int aa[N], bb[N], out[N_];
	int n, m, i;

	init();
	scanf("%d%d", &n, &m), n++, m++;
	for (i = 0; i < n; i++)
		scanf("%d", &aa[i]);
	for (i = 0; i < m; i++)
		scanf("%d", &bb[i]);
	mult(aa, n, bb, m, out);
	for (i = 0; i < n + m - 1; i++)
		printf("%d ", out[i]);
	printf("\n");
	return 0;
}