import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines # 原子根のべき乗で書いて、多項式に帰着 import numpy as np p = int(readline()) A = np.array([0] + readline().split(), np.int64) B = np.array([0] + readline().split(), np.int64) MOD = 998244353 def make_prime(U): is_prime = np.zeros(U,np.bool) is_prime[2] = 1 is_prime[3::2] = 1 M = int(U**.5)+1 for p in range(3,M,2): if is_prime[p]: is_prime[p*p::p+p] = 0 return is_prime, is_prime.nonzero()[0] def find_primitive_root(p): import random if p == 2: return 1 _, primes = make_prime(p) e = p - 1 div = [q for q in primes if not e % q] test_n = [e // q for q in div] while True: r = random.randint(1,p) if any(pow(r,int(n),p) == 1 for n in test_n): continue return r def make_power(a, L, MOD=MOD): B = L.bit_length() x = np.empty((1<> 15 gl = g & (1 << 15) - 1; gh = g >> 15 conv = lambda f,g: ifft(fft(f,fft_len) * fft(g,fft_len))[:L] x = conv(fl, gl) % MOD y = conv(fl+fh, gl+gh) % MOD z = conv(fh, gh) % MOD a, b, c = map(lambda x: (x + .5).astype(np.int64), [x,y,z]) return (a + ((b - a - c) << 15) + (c << 30)) % MOD fg = fft_convolve(f,g) L = len(fg); fg[0:L-(p-1)] += fg[p-1:L]; fg = fg[:p-1]; fg %= MOD answer = fg[log[1:]] print(' '.join(answer.astype(str)))