import sys sys.setrecursionlimit(10**7) def I(): return int(sys.stdin.readline().rstrip()) def MI(): return map(int,sys.stdin.readline().rstrip().split()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def LI2(): return list(map(int,sys.stdin.readline().rstrip())) def S(): return sys.stdin.readline().rstrip() def LS(): return list(sys.stdin.readline().rstrip().split()) def LS2(): return list(sys.stdin.readline().rstrip()) # 998244353 = 119*2**23+1 mod = 998244353 primitive_root = 3 # mod の原始根 roots = [pow(primitive_root,(mod-1) >> i,mod) for i in range(24)] inv_roots = [pow(r,mod-2,mod) for r in roots] # roots[i] = 1 の 2**i 乗根、inv_roots[i] = 1 の 2**i 乗根の逆元 def ntt(A,n): for i in range(n): m = 1 << (n-i-1) for start in range(1 << i): w = 1 start *= m*2 for j in range(m): A[start+j],A[start+j+m] = (A[start+j]+A[start+j+m]) % mod,(A[start+j]-A[start+j+m])*w % mod w *= roots[n-i] w %= mod return A def inv_ntt(A,n): for i in range(n): m = 1 << i for start in range(1 << (n-i-1)): w = 1 start *= m*2 for j in range(m): A[start+j],A[start+j+m] = (A[start+j]+A[start+j+m]*w) % mod,(A[start+j]-A[start+j+m]*w) % mod w *= inv_roots[i+1] w %= mod a = pow(2,n*(mod-2),mod) for i in range(1 << n): A[i] *= a A[i] %= mod return A def convolution(A,B): a,b = len(A),len(B) deg = a+b-2 n = deg.bit_length() N = 1 << n A += [0]*(N-a) # A の次数を 2冪-1 にする B += [0]*(N-b) # B の次数を 2冪-1 にする A = ntt(A,n) B = ntt(B,n) C = [(A[i]*B[i]) % mod for i in range(N)] C = inv_ntt(C,n) return C[:deg+1] N = I() A = [0]+LI() B = [0]+LI() AB = [a+b for a,b in zip(A,B)] X = [i for i in range(N+1)] ANS0 = convolution(AB[:],X[:]) # 1012924417 = 483*2**21+1 mod = 1012924417 primitive_root = 5 # mod の原始根 roots = [pow(primitive_root,(mod-1) >> i,mod) for i in range(22)] inv_roots = [pow(r,mod-2,mod) for r in roots] # roots[i] = 1 の 2**i 乗根、inv_roots[i] = 1 の 2**i 乗根の逆元 def ntt(A,n): for i in range(n): m = 1 << (n-i-1) for start in range(1 << i): w = 1 start *= m*2 for j in range(m): A[start+j],A[start+j+m] = (A[start+j]+A[start+j+m]) % mod,(A[start+j]-A[start+j+m])*w % mod w *= roots[n-i] w %= mod return A def inv_ntt(A,n): for i in range(n): m = 1 << i for start in range(1 << (n-i-1)): w = 1 start *= m*2 for j in range(m): A[start+j],A[start+j+m] = (A[start+j]+A[start+j+m]*w) % mod,(A[start+j]-A[start+j+m]*w) % mod w *= inv_roots[i+1] w %= mod a = pow(2,n*(mod-2),mod) for i in range(1 << n): A[i] *= a A[i] %= mod return A def convolution(A,B): a,b = len(A),len(B) deg = a+b-2 n = deg.bit_length() N = 1 << n A += [0]*(N-a) # A の次数を 2冪-1 にする B += [0]*(N-b) # B の次数を 2冪-1 にする A = ntt(A,n) B = ntt(B,n) C = [(A[i]*B[i]) % mod for i in range(N)] C = inv_ntt(C,n) return C[:deg+1] ANS1 = convolution(AB[:],X[:]) def ext_gcd(a,b): # gcd(a,b) と a*x+b*y == gcd(a,b) の整数解(x,y) if b > 0: d,x,y = ext_gcd(b,a % b) return d,y,x-(a//b)*y return a,1,0 def remainder(V): # Z == Xi (mod Yi) たる Z, lcm(Yi) x,lcm = 0,1 for X,Y in V: g,a,b = ext_gcd(lcm,Y) x,lcm = (Y*b*x+lcm*a*X)//g,lcm*(Y//g) x %= lcm return x,lcm ANS = [] for i in range(1,2*N+1): a0 = ANS0[i] a1 = ANS1[i] a,l = remainder([(a0,998244353),(a1,1012924417)]) ANS.append(a) print(*ANS)