#include #include #include using namespace std; using namespace atcoder; using mint = modint; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 4000000000000000001 template vector convolution_mint(vector a,vector b){ static constexpr unsigned long long M0 = 998244353; static constexpr unsigned long long M1 = 754974721; static constexpr unsigned long long M2 = 469762049; vector aa(a.size()),bb(b.size()); rep(i,a.size())aa[i] = a[i].val(); rep(i,b.size())bb[i] = b[i].val(); auto c0 = convolution(aa,bb); auto c1 = convolution(aa,bb); auto c2 = convolution(aa,bb); vector ret(c0.size()); rep(i,c0.size()){ ret[i] += c0[i]; { long long cur = c0[i]; cur %= M1; cur = c1[i]-cur; if(cur<0)cur += M1; cur *= 416537774; cur %= M1; mint m = M0; ret[i] += m*cur; cur *= M0; cur += c0[i]; cur %= M2; cur = c2[i] - cur; if(cur<0)cur += M2; cur *= 429847628; cur %= M2; m *= M1; ret[i] += m * cur; } } return ret; } int main(){ mint::set_mod(258280327); int N,M; cin>>N; vector a(N+1); rep(i,N+1){ long long t; cin>>t; a[i] = t; } cin>>M; vector b(M+1); rep(i,M+1){ long long t; cin>>t; b[i] = t; } a = convolution_mint(a,b); while(a.size()>1 && a.back()==0)a.pop_back(); cout<>N>>E; if(N>=0){ long long sq = sqrtl(N); if(sq*sq==N){ cout<