length = int(eval(input()))

first = input().split(" ")

second = input().split(" ")

i = 0

sweet = 0

sugars = 0

while i < length:

    j = i

    k = 0

    while k<=i:

        sweet = sweet + int(first[k])

        k = k + 1

    while j < length:

        sweet = sweet + int(second[j])

        j = j + 1

    if sweet > sugars:

        sugars = sweet

    sweet = 0

    i = i + 1

print(sugars)
n = int(input())

t = [int(i) for i in input().split(" ")]

b = [int(i) for i in input().split(" ")]



mina = None

tot = sum(t) + sum(b)

tn = sum(t) - t[0]

bn = 0

for s in range(n):

 if mina == None or mina > tn + bn:

  mina = tn + bn

 if s == n-1:

  break

 tn -= t[s+1]

 bn += b[s]



print(tot - mina)
length = int(eval(input()))
first = input().split(" ")
second = input().split(" ")
i = 0
sweet = 0
sugars = 0
while i < length:
    j = i
    k = 0
    while k <= i:
        sweet = sweet + int(first[k])
        k = k + 1
    while j < length:
        sweet = sweet + int(second[j])
        j = j + 1
    if sweet > sugars:
        sugars = sweet
    sweet = 0
    i = i + 1
print(sugars)

n = int(input())
t = [int(i) for i in input().split(" ")]
b = [int(i) for i in input().split(" ")]
mina = None
tot = sum(t) + sum(b)
tn = sum(t) - t[0]
bn = 0
for s in range(n):
    if mina == None or mina > tn + bn:
        mina = tn + bn
    if s == n - 1:
        break
    tn -= t[s + 1]
    bn += b[s]
print(tot - mina)

-length = int(eval(input())) -first = input().split(" ") -second = input().split(" ") -i = 0 -sweet = 0 -sugars = 0 -while i < length: -    j = i -    k = 0 -    while k <= i: -        sweet = sweet + int(first[k]) -        k = k + 1 -    while j < length: -        sweet = sweet + int(second[j]) -        j = j + 1 -    if sweet > sugars: -        sugars = sweet -    sweet = 0 -    i = i + 1 -print(sugars) +n = int(input()) +t = [int(i) for i in input().split(" ")] +b = [int(i) for i in input().split(" ")] +mina = None +tot = sum(t) + sum(b) +tn = sum(t) - t[0] +bn = 0 +for s in range(n): +    if mina == None or mina > tn + bn: +        mina = tn + bn +    if s == n - 1: +        break +    tn -= t[s + 1] +    bn += b[s] +print(tot - mina)