N = int(eval(input()))

A1, A2 = [input().split() for _ in range(2)]



ans = 0

sum = 0

for n in range(0, N):

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

        #print('i=', i)

        sum += int(A1[i])

    for j in range(n, N):

        #print('j=', j)

        sum += int(A2[j])

    if ans < sum:

        ans = sum

    sum = 0



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

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



ans = 0

sum = 0

for n in range(0, N):

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

        sum += A1[i]

    for j in range(n, N):

        sum += A2[j]

    if ans < sum:

        ans = sum

    sum = 0



print(ans)
N = int(eval(input()))
A1, A2 = [input().split() for _ in range(2)]
ans = 0
sum = 0
for n in range(0, N):
    for i in range(0, n + 1):
        # print('i=', i)
        sum += int(A1[i])
    for j in range(n, N):
        # print('j=', j)
        sum += int(A2[j])
    if ans < sum:
        ans = sum
    sum = 0
print(ans)

N = int(eval(input()))
A1, A2 = [list(map(int, input().split())) for _ in range(2)]
ans = 0
sum = 0
for n in range(0, N):
    for i in range(0, n + 1):
        sum += A1[i]
    for j in range(n, N):
        sum += A2[j]
    if ans < sum:
        ans = sum
    sum = 0
print(ans)

-A1, A2 = [input().split() for _ in range(2)] +A1, A2 = [list(map(int, input().split())) for _ in range(2)] -        # print('i=', i) -        sum += int(A1[i]) +        sum += A1[i] -        # print('j=', j) -        sum += int(A2[j]) +        sum += A2[j]