6
12 8 12 17 20 5
17 4 8 8 8 4
 6
4 1 12 9 3 11
12 20 19 12 19 11
 1
1
1
 2
1 2
1 1
 1
7
5
 6
16 20 18 7 14 2
17 12 4 10 7 4

705
 917
 1
 9
 5
 741

#include <bits/stdc++.h>
using namespace std;
const int N = 1e6;
int n;
int a[2][N];
long long solve() {
  long long ans = -1;
  int curi = 0;
  int curj = 0;
  int mult = 0;
  int path = 1;
  long long probans = 0;
  while (true) {
    probans += a[curi][curj] * mult;
    ++mult;
    if (curj == n - 1 && path == 1) {
      ++curi;
      path *= -1;
    } else
      curj += path;
    if (mult == 2 * n) break;
  }
  if (probans > ans) ans = probans;
  probans = a[0][0];
  curi = 1;
  curj = 0;
  path = 1;
  mult = 1;
  while (true) {
    probans += a[curi][curj] * mult;
    ++mult;
    if (curj == n - 1 && path == 1) {
      --curi;
      path *= -1;
    } else
      curj += path;
    if (mult == 2 * n) break;
  }
  if (probans > ans) ans = probans;
  probans = 0;
  curi = 0;
  curj = 0;
  int pathX = 1;
  int pathY = 0;
  mult = 0;
  while (true) {
    probans += a[curi][curj] * mult;
    ++mult;
    cout << probans << ' ';
    curi += pathX;
    curj += pathY;
    if (curi == 1 && pathY == 0) {
      pathY = 1;
      pathX = 0;
    } else if (curi == 1 && pathY == 1) {
      pathY = 0;
      pathX = -1;
    }
    if (curi == 0 && pathY == 0) {
      pathY = 1;
      pathX = 0;
    } else if (curi == 0 && pathY == 1) {
      pathY = 0;
      pathX = 1;
    }
    if (mult == 2 * n) break;
  }
  return max(probans, ans);
}
int main() {
  cin >> n;
  int maxi;
  int maxj;
  int maxval = -1;
  for (int i = 0; i < 2; ++i) {
    for (int j = 0; j < n; ++j) {
      cin >> a[i][j];
    }
  }
  cout << solve();
}
