from collections import * import sys import heapq from heapq import heapify, heappop, heappush import bisect from bisect import bisect_left, bisect_right import itertools from functools import lru_cache from types import GeneratorType from fractions import Fraction import math import copy import random # import numpy as np # sys.setrecursionlimit(int(1e7)) # @lru_cache(maxsize=None) # CPython特化 # @bootstrap # PyPy特化(こっちのほうが速い) yield dfs(), yield Noneを忘れずに def bootstrap(f, stack=[]): # yield def wrappedfunc(*args, **kwargs): if stack: return f(*args, **kwargs) else: to = f(*args, **kwargs) while True: if type(to) is GeneratorType: stack.append(to) to = next(to) else: stack.pop() if not stack: break to = stack[-1].send(to) return to return wrappedfunc dxdy1 = ((0, 1), (0, -1), (1, 0), (-1, 0)) # 上下右左 dxdy2 = ( (0, 1), (0, -1), (1, 0), (-1, 0), (1, 1), (-1, -1), (1, -1), (-1, 1), ) # 8方向すべて dxdy3 = ((0, 1), (1, 0)) # 右 or 下 dxdy4 = ((1, 1), (1, -1), (-1, 1), (-1, -1)) # 斜め INF = float("inf") _INF = 1 << 60 MOD = 998244353 mod = 998244353 MOD2 = 10**9 + 7 mod2 = 10**9 + 7 # memo : len([a,b,...,z])==26 # memo : 2^20 >= 10^6 # 小数の計算を避ける : x/y -> (x*big)//y ex:big=10**9 # @:小さい文字, ~:大きい文字,None: 空の文字列 # ユークリッドの互除法:gcd(x,y)=gcd(x,y-x) # memo : d 桁以下の p 進表記を用いると p^d-1 以下のすべての # 非負整数を表現することができる # memo : (X,Y) -> (X+Y,X−Y) <=> 点を原点を中心に45度回転し、√2倍に拡大 # memo : (x,y)のx正から見た偏角をラジアンで(-πからπ]: math.atan2(y, x) # memo : a < bのとき ⌊a⌋ ≦ ⌊b⌋ input = lambda: sys.stdin.readline().rstrip() mi = lambda: map(int, input().split()) li = lambda: list(mi()) ii = lambda: int(input()) py = lambda: print("Yes") pn = lambda: print("No") pf = lambda: print("First") ps = lambda: print("Second") N = ii() A = li() B = li() C = li() dp = [[0] * 5 for _ in range(N + 1)] for i in range(N): for j in range(5): tmp = 0 for k in range(j + 1): tmp = max(tmp, dp[i][k]) if j == 0 or j == 4: dp[i + 1][j] = tmp + A[i] if j == 1 or j == 3: dp[i + 1][j] = tmp + B[i] if j == 2: dp[i + 1][j] = tmp + C[i] dp2 = [[0] * 5 for _ in range(N + 1)] for i in range(N): for j in range(5): tmp = 0 for k in range(j + 1): tmp = max(tmp, dp2[i][k]) if j == 0 or j == 2 or j == 4: dp2[i + 1][j] = tmp + A[i] if j == 1 or j == 3: dp2[i + 1][j] = tmp + B[i] print(max(max(dp[-1]), max(dp2[-1])))