n = int(eval(input()))

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

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

ans = [0]*n

for i in range(n):

  ans[i] = a1[0:i+1] + a2[i::]

  ans[i] = sum(ans[i])

print((max(ans)))
n = int(eval(input()))

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

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

ans = [0]*n

for i in range(n):

  ans[i] = sum(a1[0:i+1]) + sum(a2[i::])

print((max(ans)))
n = int(eval(input()))
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
ans = [0] * n
for i in range(n):
    ans[i] = a1[0 : i + 1] + a2[i::]
    ans[i] = sum(ans[i])
print((max(ans)))

n = int(eval(input()))
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
ans = [0] * n
for i in range(n):
    ans[i] = sum(a1[0 : i + 1]) + sum(a2[i::])
print((max(ans)))

-    ans[i] = a1[0 : i + 1] + a2[i::] -    ans[i] = sum(ans[i]) +    ans[i] = sum(a1[0 : i + 1]) + sum(a2[i::])