from sys import stdin

from itertools import combinations

from math import factorial

import numpy as np



n = int(stdin.readline().rstrip())

    

li = list(map(int,stdin.readline().rstrip().split()))

lin = list(map(int,stdin.readline().rstrip().split()))

ma = 0

for i in range(n):

    ma = max(sum(li[:i+1]+lin[i:]),ma)



print(ma)
n = int(eval(input()))

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



ma = 0



for i in range(n):

    ma = max(ma,sum(li[0][:i+1])+sum(li[1][i:]))



print(ma)
from sys import stdin
from itertools import combinations
from math import factorial
import numpy as np

n = int(stdin.readline().rstrip())
li = list(map(int, stdin.readline().rstrip().split()))
lin = list(map(int, stdin.readline().rstrip().split()))
ma = 0
for i in range(n):
    ma = max(sum(li[: i + 1] + lin[i:]), ma)
print(ma)

n = int(eval(input()))
li = [list(map(int, input().split())) for _ in range(2)]
ma = 0
for i in range(n):
    ma = max(ma, sum(li[0][: i + 1]) + sum(li[1][i:]))
print(ma)

-from sys import stdin -from itertools import combinations -from math import factorial -import numpy as np - -n = int(stdin.readline().rstrip()) -li = list(map(int, stdin.readline().rstrip().split())) -lin = list(map(int, stdin.readline().rstrip().split())) +n = int(eval(input())) +li = [list(map(int, input().split())) for _ in range(2)] -    ma = max(sum(li[: i + 1] + lin[i:]), ma) +    ma = max(ma, sum(li[0][: i + 1]) + sum(li[1][i:]))