n = int(eval(input()))

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

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



ans = [0] * n

for i in range(n):

    ans[i] = sum(a1[:i+1]) + sum(a2[i:])



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

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

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



ans = 0

for i in range(n):

    ans = max(ans, sum(a1[:i+1]) + sum(a2[i:]))



print(ans)
n = int(eval(input()))
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
ans = [0] * n
for i in range(n):
    ans[i] = sum(a1[: i + 1]) + sum(a2[i:])
print((max(ans)))

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

-ans = [0] * n +ans = 0 -    ans[i] = sum(a1[: i + 1]) + sum(a2[i:]) -print((max(ans))) +    ans = max(ans, sum(a1[: i + 1]) + sum(a2[i:])) +print(ans)