#include using namespace std; using ll = long long; using Vl = vector; int main () { int N; cin >> N; Vl A(N); Vl B(N); for (int i = 0; i < N; i ++) { cin >> A[i]; } for (int i = 0; i < N; i ++) { cin >> B[i]; } Vl A1(N + 1); Vl B1(N + 1); Vl A2(N + 1); Vl B2(N + 1); A1[0] = B1[0] = A2[0] = B2[0] = 0; for (int i = 1; i <= N; i ++) { A1[i] = A1[i - 1] + A[i - 1]; B1[i] = B1[i - 1] + B[i - 1]; A2[i] = A2[i - 1] + i * A[i - 1]; B2[i] = B2[i - 1] + i * B[i - 1]; } for (int i = 1; i <= 2 * N; i ++) { int al = min(N, i - 1); int bt = max(1, i - N) - 1; ll a = i * (A1[al] - A1[bt]) - (A2[al] - A2[bt]); ll b = i * (B1[al] - B1[bt]) - (B2[al] - B2[bt]); cout << a + b << (i < N * 2 ? " " : ""); } cout << endl; }