n = int(eval(input()))

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

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



ans = 0

for i in range(n):

    total = 0

    num = i

    while num >= 0:

        total += c1[num]

        num -= 1

    for j in range(i,n):

        total += c2[j]

    ans = max(ans, total)

print(ans)

n = int(eval(input()))

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

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



ans = 0

for i in range(n):

    ans = max(ans, sum(c1[:i+1] + c2[i:]))



print(ans)

n = int(eval(input()))
c1 = list(map(int, input().split()))
c2 = list(map(int, input().split()))
ans = 0
for i in range(n):
    total = 0
    num = i
    while num >= 0:
        total += c1[num]
        num -= 1
    for j in range(i, n):
        total += c2[j]
    ans = max(ans, total)
print(ans)

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

-    total = 0 -    num = i -    while num >= 0: -        total += c1[num] -        num -= 1 -    for j in range(i, n): -        total += c2[j] -    ans = max(ans, total) +    ans = max(ans, sum(c1[: i + 1] + c2[i:]))