#include #include using namespace std; using namespace atcoder; const long long mod = 258280327; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; vector a(n + 1); for (int i = 0; i < n + 1; i++) { cin >> a[i]; a[i] %= mod; } int m; cin >> m; vector b(m + 1); for (int i = 0; i < m + 1; i++) { cin >> b[i]; b[i] %= mod; } auto c = convolution<(long long) 258280327>(a, b); cout << n + m << '\n'; for (int i = 0; i < (int) c.size(); i++) { cout << c[i] << " \n"[i + 1 == (int) c.size()]; } }