N = int(eval(input()))

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

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



ans = 0

for i in range(N):

    tmp = sum(s1[:i+1]) + sum(s2[i:])

    ans = max(ans, tmp)

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

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

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



ans = 0

for i in range(N):

    tmp = sum(S0[:i+1]) + sum(S1[i:])

    ans = max(tmp,ans)

print(ans)
N = int(eval(input()))
s1 = list(map(int, input().split()))
s2 = list(map(int, input().split()))
ans = 0
for i in range(N):
    tmp = sum(s1[: i + 1]) + sum(s2[i:])
    ans = max(ans, tmp)
print(ans)

N = int(eval(input()))
S0 = list(map(int, input().split()))
S1 = list(map(int, input().split()))
ans = 0
for i in range(N):
    tmp = sum(S0[: i + 1]) + sum(S1[i:])
    ans = max(tmp, ans)
print(ans)

-s1 = list(map(int, input().split())) -s2 = list(map(int, input().split())) +S0 = list(map(int, input().split())) +S1 = list(map(int, input().split())) -    tmp = sum(s1[: i + 1]) + sum(s2[i:]) -    ans = max(ans, tmp) +    tmp = sum(S0[: i + 1]) + sum(S1[i:]) +    ans = max(tmp, ans)