#include using namespace std; using ll = long long; using P = pair; #define rep(i, a, b) for(ll i = a; i < b; ++i) #define rrep(i, a, b) for(ll i = a; i >= b; --i) constexpr ll inf = 4e18; struct SetupIO { SetupIO() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(30); } } setup_io; int main(void) { ll n; cin >> n; vector> a(3, vector(n)); rep(i, 0, 3) { rep(j, 0, n) { cin >> a[i][j]; } } vector>> dp(n + 1, vector>(3, vector(3, -inf))); dp[0][0][0] = 0; rep(i, 0, n) { rep(j, 0, 3) { rep(k, 0, j + 1) { rep(j1, 0, j + 1) { rep(k1, 0, min(k, j1) + 1) { dp[i + 1][j][k] = max(dp[i + 1][j][k], dp[i][j1][k1] + a[int(j == 1) + int(k == 1)][i]); } } } } } ll ans = 0; rep(i, 0, 3) { rep(j, 0, 3) { ans = max(ans, dp[n][i][j]); } } cout << ans << '\n'; }