N = int(eval(input()))

A = [list(map(int, input().split())) for k in range(2)]

ans = 0



for k in range(N):

    ans = max(ans,sum(A[0][0:k+1])+sum(A[1][k:]))

print(ans)

N = int(eval(input()))

A = list(map(int,input().split()))

B = list(map(int,input().split()))

ans = 0

for k in range(N):

    ans = max(ans,sum(A[:k+1])+sum(B[k:]))

print(ans)

N = int(eval(input()))
A = [list(map(int, input().split())) for k in range(2)]
ans = 0
for k in range(N):
    ans = max(ans, sum(A[0][0 : k + 1]) + sum(A[1][k:]))
print(ans)

N = int(eval(input()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
ans = 0
for k in range(N):
    ans = max(ans, sum(A[: k + 1]) + sum(B[k:]))
print(ans)

-A = [list(map(int, input().split())) for k in range(2)] +A = list(map(int, input().split())) +B = list(map(int, input().split())) -    ans = max(ans, sum(A[0][0 : k + 1]) + sum(A[1][k:])) +    ans = max(ans, sum(A[: k + 1]) + sum(B[k:]))