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()) class NTT(): def __init__(self,p): self.p = p self.primitive_root = 1 self.e = 0 if p == 998244353: # 998244353 = 1+119*2^23 self.primitive_root = 3 self.e = 23 elif p == 1012924417: # 1012924417 = 1+483*2^21 self.primitive_root = 5 self.e = 21 elif p == 1224736769: # 1224736769 = 1+73*2^24 self.primitive_root = 3 self.e = 24 self.roots = [pow(self.primitive_root,(p-1) >> i,p) for i in range(self.e+1)] self.inv_roots = [pow(r,p-2,p) for r in self.roots] def ntt(self,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]) % self.p,(A[start+j]-A[start+j+m])*w % self.p w *= self.roots[n - i] w %= self.p return A def inv_ntt(self,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) % self.p,(A[start+j]-A[start+j+m]*w) % self.p w *= self.inv_roots[i+1] w %= self.p a = pow(2,n*(self.p-2),self.p) for i in range(1 << n): A[i] *= a A[i] %= self.p return A def convolution(self,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 にする FA = self.ntt(A,n) FB = self.ntt(B,n) FC = [(FA[i]*FB[i]) % self.p for i in range(N)] C = self.inv_ntt(FC,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)] mod0 = 998244353 ntt0 = NTT(mod0) ANS0 = ntt0.convolution(AB[:],X[:]) mod1 = 1012924417 ntt1 = NTT(mod1) ANS1 = ntt1.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,mod0),(a1,mod1)]) ANS.append(a) print(*ANS)