n = int(eval(input()))

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

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



l = []

cnt = 0

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

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

    l.append(cnt)

    cnt = 0

print((max(l)))

n = int(eval(input()))

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

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



total = sum(a2)+a1[0]

ans = total

for i in range(1, n):

    total = total + a1[i] - a2[i-1]

    ans = max(ans, total)



print(ans)

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

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

-l = [] -cnt = 0 -for i in range(1, n + 1): -    cnt = sum(a1[:i]) + sum(a2[i - 1 :]) -    l.append(cnt) -    cnt = 0 -print((max(l))) +total = sum(a2) + a1[0] +ans = total +for i in range(1, n): +    total = total + a1[i] - a2[i - 1] +    ans = max(ans, total) +print(ans)