N = int(eval(input()))

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

ans = 0

for n in range(N):

    score = sum(A[0][:n + 1]) + sum(A[1][n:])

    ans = max(ans, score)

print(ans)
n = int(eval(input()))

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

ans = 0

for i in range(n):

    score = sum(A[0][:i + 1] + A[1][i:])

    ans = max(ans, score)

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

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

-N = int(eval(input())) +n = int(eval(input())) -for n in range(N): -    score = sum(A[0][: n + 1]) + sum(A[1][n:]) +for i in range(n): +    score = sum(A[0][: i + 1] + A[1][i:])