#pragma region Macros #include // #include using namespace std; using namespace __gnu_pbds; // using namespace __gnu_cxx; // #include // using namespace atcoder; // #include // namespace mp = boost::multiprecision; // using Bint = mp::cpp_int; #define TO_STRING(var) # var #define pb emplace_back #define int ll #define endl '\n' using ll = long long; using ld = long double; const ld PI = acos(-1); const ld EPS = 1e-10; const ll INFL = 1LL << 61; const int MOD = 998244353; // const int MOD = 1000000007; __attribute__((constructor)) void constructor() { ios::sync_with_stdio(false); cin.tie(nullptr); cout << fixed << setprecision(15); } int modpow(int x, int N, int mod) { int ret = 1; while (N > 0) { if (N % 2 == 1) ret = ret * x % mod; x = x * x % mod; N /= 2; } return ret; } int ceil(int x, int y) { return (x > 0 ? (x + y - 1) / y : x / y); } #pragma endregion signed main() { int N; cin >> N; vector A(2 * N); for (int i = 0; i < 2 * N; i++) cin >> A[i]; vector B(2 * N); for (int i = 0; i < 2 * N; i++) cin >> B[i]; vector X(N); for (int i = 0; i < N; i++) cin >> X[i]; vector Y(N); for (int i = 0; i < N; i++) cin >> Y[i]; vector> dp(2 * N, vector(2)); dp[0][0] = A[0]; dp[0][1] = B[0]; for (int i = 1; i < 2 * N; i++) { if (i % 2) { // 偶数番目なら dp[i][0] = max(dp[i - 1][0] + X[i / 2], dp[i - 1][1] + Y[i / 2]) + A[i]; dp[i][1] = max(dp[i - 1][1] + X[i / 2], dp[i - 1][0] + Y[i / 2]) + B[i]; } else { dp[i][0] = max(dp[i - 1][0], dp[i - 1][1]) + A[i]; dp[i][1] = max(dp[i - 1][0], dp[i - 1][1]) + B[i]; } } cout << max(dp[2 * N - 1][0], dp[2 * N - 1][1]) << endl; }