N = int(eval(input()))

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

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

Cmax = 0

for i in range(N):

    C = sum(A1[:i + 1]) + sum(A2[i:])

    Cmax = max(Cmax, C)

print(Cmax)
N = int(eval(input()))

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

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

C = 0

c = 0

for i in range(N):

    c = sum(A1[:i + 1]) + sum(A2[i:])

    C = max(C, c)

print(C)    
N = int(eval(input()))
A1 = list((list(map(int, input().split()))))
A2 = list((list(map(int, input().split()))))
Cmax = 0
for i in range(N):
    C = sum(A1[: i + 1]) + sum(A2[i:])
    Cmax = max(Cmax, C)
print(Cmax)

N = int(eval(input()))
A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
C = 0
c = 0
for i in range(N):
    c = sum(A1[: i + 1]) + sum(A2[i:])
    C = max(C, c)
print(C)

-A1 = list((list(map(int, input().split())))) -A2 = list((list(map(int, input().split())))) -Cmax = 0 +A1 = list(map(int, input().split())) +A2 = list(map(int, input().split())) +C = 0 +c = 0 -    C = sum(A1[: i + 1]) + sum(A2[i:]) -    Cmax = max(Cmax, C) -print(Cmax) +    c = sum(A1[: i + 1]) + sum(A2[i:]) +    C = max(C, c) +print(C)