N = int(eval(input()))

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



ma = 0

for i in range(N):

  ma = max(ma, sum(A[0][0:i+1])+sum(A[1][i:]))

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

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

candie = 0

for i in range(N):

  candie = max(candie, sum(A[0][0:i+1]) + sum(A[1][i:]))

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

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

-ma = 0 +candie = 0 -    ma = max(ma, sum(A[0][0 : i + 1]) + sum(A[1][i:])) -print(ma) +    candie = max(candie, sum(A[0][0 : i + 1]) + sum(A[1][i:])) +print(candie)