n = int(eval(input()))

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

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



num = a1[0] + a2[n-1]



def f(i):

    if n == 1:

        return 0



    elif i < n-2:

        return max(sum(a2[i:n - 1]), a1[i + 1] + f(i + 1))



    else:

        return max(a1[n-1], a2[n-2])



print((f(0) + num))

n = int(eval(input()))

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



dp = [[0 for i in range(2)] for j in range(n)]

dp[0][0] = a[0][0]

dp[0][1] = a[0][0] + a[1][0]



for i in range(n-1):

    dp[i+1][0] = dp[i][0] + a[0][i+1]

    dp[i+1][1] = max(dp[i][1] + a[1][i+1], dp[i+1][0] + a[1][i+1])



print((dp[n-1][1]))
n = int(eval(input()))
a1 = [int(i) for i in input().split()]
a2 = [int(i) for i in input().split()]
num = a1[0] + a2[n - 1]


def f(i):
    if n == 1:
        return 0
    elif i < n - 2:
        return max(sum(a2[i : n - 1]), a1[i + 1] + f(i + 1))
    else:
        return max(a1[n - 1], a2[n - 2])


print((f(0) + num))

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

-a1 = [int(i) for i in input().split()] -a2 = [int(i) for i in input().split()] -num = a1[0] + a2[n - 1] - - -def f(i): -    if n == 1: -        return 0 -    elif i < n - 2: -        return max(sum(a2[i : n - 1]), a1[i + 1] + f(i + 1)) -    else: -        return max(a1[n - 1], a2[n - 2]) - - -print((f(0) + num)) +a = [list(map(int, input().split())) for i in range(2)] +dp = [[0 for i in range(2)] for j in range(n)] +dp[0][0] = a[0][0] +dp[0][1] = a[0][0] + a[1][0] +for i in range(n - 1): +    dp[i + 1][0] = dp[i][0] + a[0][i + 1] +    dp[i + 1][1] = max(dp[i][1] + a[1][i + 1], dp[i + 1][0] + a[1][i + 1]) +print((dp[n - 1][1]))