#include #include using namespace std; using namespace atcoder; 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]; } int m; cin >> m; vector b(m + 1); for (int i = 0; i < m + 1; i++) { cin >> b[i]; } 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()]; } }