import sys input = lambda : sys.stdin.readline().rstrip() sys.setrecursionlimit(2*10**5+10) write = lambda x: sys.stdout.write(x+"\n") debug = lambda x: sys.stderr.write(x+"\n") writef = lambda x: print("{:.12f}".format(x)) # FFT import numpy as np TYPE = np.int64 M = 998244353 def fft(a,b): l = len(a) + len(b) - 1 l = 1<<((l-1).bit_length()) c = np.fft.irfft((np.fft.rfft(a,l))*(np.fft.rfft(b,l)),l) c = np.rint(c).astype(TYPE) return c def fft_large(a,b): d = 30000 a1, a2 = np.divmod(a,d) b1, b2 = np.divmod(b,d) aa = fft(a1,b1) % M bb = fft(a2,b2) % M cc = (fft(a1+a2, b1+b2) - (aa+bb)) % M h = (((aa*d)%M)*d + cc*d + bb) % M return h def fft_large(a,b): """精度が足りないときはこちら """ d = 1<<10 a1, a2 = np.divmod(a,d*d) a2, a3 = np.divmod(a2,d) b1, b2 = np.divmod(b,d*d) b2, b3 = np.divmod(b2,d) aa = fft(a1,b1) % M bb = fft(a2,b2) % M cc = fft(a3,b3) % M dd = (fft(a1+a2, b1+b2) - (aa+bb)) % M ee = (fft(a2+a3, b2+b3) - (bb+cc)) % M ff = (fft(a1+a3, b1+b3) - (aa+cc)) % M h = (((aa*d*d)%M)*d*d + ((dd*d*d)%M)*d + (bb+ff)*d*d + ee*d + cc) % M return h n = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) a = np.array(a, dtype=np.int64) b = np.array(b, dtype=np.int64) aa = fft_large(np.arange(1,n+1).astype(np.int64), a) bb = fft_large(np.arange(1,n+1), b) ans = [0] + (aa+bb)[:2*n-1].tolist() write(" ".join(map(str, ans)))