#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; int main(){ ll N; cin >> N; vector A(2*N+1), B(2*N+1), X(2*N+1), Y(2*N+1); vector> dp(2*N+1, vector(2)); for (int i=1; i<=2*N; i++) cin >> A[i]; for (int i=1; i<=2*N; i++) cin >> B[i]; for (int i=1; i<=N; i++) cin >> X[i*2]; for (int i=1; i<=N; i++) cin >> Y[i*2]; dp[1][0] = A[1]; dp[1][1] = B[1]; for (int i=2; i<=2*N; i++){ dp[i][0] = max(dp[i-1][0] + X[i], dp[i-1][1] + Y[i]) + A[i]; dp[i][1] = max(dp[i-1][0] + Y[i], dp[i-1][1] + X[i]) + B[i]; } cout << max(dp[N*2][0], dp[N*2][1]) << endl; return 0; }