import std.stdio,
       std.string,
       std.conv,
       std.algorithm;

void main() {
  int N = readln.chomp.to!(int);
  int[][] arr;
  int[][] po;
  for (int i = 0; i < 2; i++) {
    auto tmp = readln.chomp.split.to!(int[]);
    arr ~= tmp.dup;
    po ~= tmp.dup;
  }

  if (N == 1) {
    writeln(arr[0][0] + arr[1][0]);
    return;
  }

  for (int i = N - 2; i >= 0; i--) {
    po[0][i] += po[0][i + 1];
    po[1][i] += po[1][i + 1];
  }

  int ans, row;
  for (int i = 0; i < N; i++) {
    if (row != 1 && po[0][i + 1] < po[1][i]) {
      ans += arr[row][i];
      row = 1;
    }
    ans += arr[row][i];
  }

  writeln(ans);
}
