res = 0

n = int(eval(input()))

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

# したにいくます

for i in range(n):

    t = 0

    tmp = 0

    for j in range(n):

        tmp += a[t][j]

        if i==j:

            t += 1

            tmp += a[t][j]

    res = max(res,tmp)

print(res)

n = int(eval(input()))

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

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



res = 0

for i in range(n):

    tmp = 0

    for j in range(i + 1):

        tmp += a[j]

    for j in range(i, n):

        tmp += b[j]

    res = max(res, tmp)

print(res)

res = 0
n = int(eval(input()))
a = [list(map(int, input().split())) for _ in range(2)]
# したにいくます
for i in range(n):
    t = 0
    tmp = 0
    for j in range(n):
        tmp += a[t][j]
        if i == j:
            t += 1
            tmp += a[t][j]
    res = max(res, tmp)
print(res)

n = int(eval(input()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
res = 0
for i in range(n):
    tmp = 0
    for j in range(i + 1):
        tmp += a[j]
    for j in range(i, n):
        tmp += b[j]
    res = max(res, tmp)
print(res)

+n = int(eval(input())) +a = list(map(int, input().split())) +b = list(map(int, input().split())) -n = int(eval(input())) -a = [list(map(int, input().split())) for _ in range(2)] -# したにいくます -    t = 0 -    for j in range(n): -        tmp += a[t][j] -        if i == j: -            t += 1 -            tmp += a[t][j] +    for j in range(i + 1): +        tmp += a[j] +    for j in range(i, n): +        tmp += b[j]