N = int(eval(input()))

A = [[int(i) for i in input().split()] for _ in range(2)]



# dpj[i]: (i,j)でアメの最大値

dp1 = [0] * N

dp2 = [0] * N



# 初期条件

dp1[0] = A[0][0]

dp2[0] = A[0][0] + A[1][0]



# 貰うdp

for i in range(1,N):

    dp1[i] = dp1[i-1] + A[0][i]



for i in range(1,N):

    dp2[i] = max(dp1[i], dp2[i-1]) + A[1][i]



print((dp2[-1]))
N = int(eval(input()))

A = [[0] + [int(i) for i in input().split()] for _ in range(2)]



for i in range(N):

    A[0][i+1] += A[0][i]

    A[1][i+1] += A[1][i]



ans = 0

for i in range(1,N+1):

    ans = max(ans, A[0][i] + (A[1][-1] -A[1][i-1]))



print(ans)
N = int(eval(input()))
A = [[int(i) for i in input().split()] for _ in range(2)]
# dpj[i]: (i,j)でアメの最大値
dp1 = [0] * N
dp2 = [0] * N
# 初期条件
dp1[0] = A[0][0]
dp2[0] = A[0][0] + A[1][0]
# 貰うdp
for i in range(1, N):
    dp1[i] = dp1[i - 1] + A[0][i]
for i in range(1, N):
    dp2[i] = max(dp1[i], dp2[i - 1]) + A[1][i]
print((dp2[-1]))

N = int(eval(input()))
A = [[0] + [int(i) for i in input().split()] for _ in range(2)]
for i in range(N):
    A[0][i + 1] += A[0][i]
    A[1][i + 1] += A[1][i]
ans = 0
for i in range(1, N + 1):
    ans = max(ans, A[0][i] + (A[1][-1] - A[1][i - 1]))
print(ans)

-A = [[int(i) for i in input().split()] for _ in range(2)] -# dpj[i]: (i,j)でアメの最大値 -dp1 = [0] * N -dp2 = [0] * N -# 初期条件 -dp1[0] = A[0][0] -dp2[0] = A[0][0] + A[1][0] -# 貰うdp -for i in range(1, N): -    dp1[i] = dp1[i - 1] + A[0][i] -for i in range(1, N): -    dp2[i] = max(dp1[i], dp2[i - 1]) + A[1][i] -print((dp2[-1])) +A = [[0] + [int(i) for i in input().split()] for _ in range(2)] +for i in range(N): +    A[0][i + 1] += A[0][i] +    A[1][i + 1] += A[1][i] +ans = 0 +for i in range(1, N + 1): +    ans = max(ans, A[0][i] + (A[1][-1] - A[1][i - 1])) +print(ans)