#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int, int>
#define all(c) ((c).begin()), ((c).end())
#define sz(x) ((int)(x).size())
#ifdef LOCAL
#include <print.h>
#else
#define trace(...)
#endif
#include <atcoder/convolution>
using namespace atcoder;
using mint = modint998244353;
using poly = vector< mint> ;
poly operator + ( const poly & A, const poly & B) {
int n = max( A.size ( ) , B.size ( ) ) ;
poly ret( n) ;
for ( int i = 0 ; i < n; i++ ) {
ret[ i] = ( i < ( int ) A.size ( ) ? A[ i] : 0 ) + ( i < ( int ) B.size ( ) ? B[ i] : 0 ) ;
}
return ret;
}
poly operator * ( const poly & A, const poly & B) {
return convolution( A, B) ;
}
poly inverse( const poly & A, int s) {
assert ( A[ 0 ] ! = mint( 0 ) ) ;
poly X = { 1 / A[ 0 ] } ;
while ( ( int ) X.size ( ) < s) {
poly temp( A.begin ( ) , A.begin ( ) + min( A.size ( ) , 2 * X.size ( ) ) ) ;
poly nx = X * X * temp;
X.resize ( 2 * X.size ( ) ) ;
for ( int i = 0 ; i < X.size ( ) ; i++ ) {
X[ i] = 2 * X[ i] - nx[ i] ;
}
}
X.resize ( s) ;
return X;
}
int main( ) {
ios_base:: sync_with_stdio ( false ) ;
cin .tie ( NULL ) ; // Remove in interactive problems
int n; cin >> n;
vector< int > A( n) , B( n) , C( n) ;
for ( int i = 0 ; i < n; i++ ) cin >> A[ i] ;
for ( int i = 0 ; i < n; i++ ) cin >> B[ i] ;
for ( int i = 0 ; i < n; i++ ) cin >> C[ i] ;
function< pair< poly, poly> ( int , int ) > getT = [ & ] ( int L, int R) {
if ( L == R) {
return make_pair( poly( { C[ L] } ) , poly( { 1 , - A[ L] } ) ) ;
}
int mid = ( L + R) >> 1 ;
pair< poly, poly> P = getT( L, mid) , Q = getT( mid + 1 , R) ;
return make_pair( P.first * Q.second + Q.first * P.second , P.second * Q.second ) ;
} ;
vector< mint> ans( n) ;
function< poly( poly, int , int ) > recurse = [ & ] ( poly T, int L, int R) {
if ( L == R) {
ans[ L] = T[ 0 ] * B[ L] + T[ 1 ] ;
return poly( { B[ L] , 1 } ) ;
}
int mid = ( L + R) >> 1 ;
int OFFSET = mid - L + 2 ;
poly X( T.begin ( ) , T.begin ( ) + OFFSET) ;
poly temp = recurse( X, L, mid) ;
poly P( OFFSET + 1 ) ;
for ( int i = 0 ; i < OFFSET; i++ ) P[ OFFSET - i] = temp[ i] ;
T = T * P;
poly Q( T.begin ( ) + OFFSET, T.begin ( ) + OFFSET + R - mid + 1 ) ;
return recurse( Q, mid + 1 , R) * temp;
} ;
pair< poly, poly> X = getT( 0 , n - 1 ) ;
poly T = X.first * inverse( X.second , n + 1 ) ;
T.resize ( n + 1 ) ;
recurse( T, 0 , n - 1 ) ;
for ( int i = 0 ; i < n; i++ ) {
cout << ans[ i] .val ( ) << " " ;
}
cout << endl;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgojZGVmaW5lIGxsIGxvbmcgbG9uZwojZGVmaW5lIHBpaSBwYWlyPGludCwgaW50PgojZGVmaW5lIGFsbChjKSAoKGMpLmJlZ2luKCkpLCAoKGMpLmVuZCgpKQojZGVmaW5lIHN6KHgpICgoaW50KSh4KS5zaXplKCkpCgojaWZkZWYgTE9DQUwKI2luY2x1ZGUgPHByaW50Lmg+CiNlbHNlCiNkZWZpbmUgdHJhY2UoLi4uKQojZW5kaWYKCiNpbmNsdWRlIDxhdGNvZGVyL2NvbnZvbHV0aW9uPgp1c2luZyBuYW1lc3BhY2UgYXRjb2RlcjsKdXNpbmcgbWludCA9IG1vZGludDk5ODI0NDM1MzsKdXNpbmcgcG9seSA9IHZlY3RvcjxtaW50PjsKCnBvbHkgb3BlcmF0b3IgKyAoY29uc3QgcG9seSAmIEEsIGNvbnN0IHBvbHkgJiBCKXsKICAgIGludCBuID0gbWF4KEEuc2l6ZSgpLCBCLnNpemUoKSk7CiAgICBwb2x5IHJldChuKTsKICAgIGZvcihpbnQgaSA9IDA7IGkgPCBuOyBpKyspewogICAgICAgIHJldFtpXSA9IChpIDwgKGludClBLnNpemUoKSA/IEFbaV0gIDogMCkgKyAoaSA8IChpbnQpQi5zaXplKCkgPyBCW2ldIDogMCk7CiAgICB9CiAgICByZXR1cm4gcmV0Owp9Cgpwb2x5IG9wZXJhdG9yICogKGNvbnN0IHBvbHkgJiBBLCBjb25zdCBwb2x5ICYgQil7CiAgICByZXR1cm4gY29udm9sdXRpb24oQSwgQik7Cn0KCnBvbHkgaW52ZXJzZShjb25zdCBwb2x5ICYgQSwgaW50IHMpewogICAgYXNzZXJ0KEFbMF0gIT0gbWludCgwKSk7CiAgICBwb2x5IFggPSB7MSAvIEFbMF19OwogICAgd2hpbGUoKGludClYLnNpemUoKSA8IHMpewogICAgICAgIHBvbHkgdGVtcChBLmJlZ2luKCksIEEuYmVnaW4oKSArIG1pbihBLnNpemUoKSwgMiAqIFguc2l6ZSgpKSk7CiAgICAgICAgcG9seSBueCA9IFggKiBYICogdGVtcDsKICAgICAgICBYLnJlc2l6ZSgyICogWC5zaXplKCkpOwogICAgICAgIGZvcihpbnQgaSA9IDA7IGkgPCBYLnNpemUoKTsgaSsrKXsKICAgICAgICAgICAgWFtpXSA9IDIgKiBYW2ldIC0gbnhbaV07CiAgICAgICAgfQogICAgfQogICAgWC5yZXNpemUocyk7CiAgICByZXR1cm4gWDsKfQoKaW50IG1haW4oKXsKCWlvc19iYXNlOjpzeW5jX3dpdGhfc3RkaW8oZmFsc2UpOyAKCWNpbi50aWUoTlVMTCk7IC8vIFJlbW92ZSBpbiBpbnRlcmFjdGl2ZSBwcm9ibGVtcwoJaW50IG47IGNpbiA+PiBuOwoJdmVjdG9yPGludD4gQShuKSwgQihuKSwgQyhuKTsKCWZvcihpbnQgaSA9IDA7IGkgPCBuOyBpKyspIGNpbiA+PiBBW2ldOwoJZm9yKGludCBpID0gMDsgaSA8IG47IGkrKykgY2luID4+IEJbaV07Cglmb3IoaW50IGkgPSAwOyBpIDwgbjsga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