import sys

from collections import deque



def solve():

    input = sys.stdin.readline

    N = int(eval(input()))

    A = [[int(a) for a in input().split()] for _ in range(2)]

    M = ((1, 0), (0, 1))

    q = deque()

    q.append((0, 0, 0))

    C = [[0] * N for _ in range(2)]

    while q:

        i, j, n = q.popleft()

        if n + A[i][j] > C[i][j]:

            C[i][j] = n + A[i][j]

            for di, dj in M:

                if 0 <= i + di < 2 and 0 <= j + dj < N:

                    q.append((i + di, j + dj, C[i][j]))

    print((C[1][N-1]))





    return 0



if __name__ == "__main__":

    solve()
import sys





def solve():

    input = sys.stdin.readline

    N = int(eval(input()))

    A = [[int(a) for a in input().split()] for _ in range(2)]

    first = [0] * N

    second = [0] * N

    first[0] = A[0][0]

    second[N-1] = A[1][N-1]

    for i in range(1, N):

        first[i] = first[i-1] + A[0][i]

        second[N - 1- i] = second[N - i] + A[1][N - 1- i]    

    maxPoint = 0

    for i in range(N):

        maxPoint = max(maxPoint, first[i] + second[i])

    print(maxPoint)



    return 0



if __name__ == "__main__":

    solve()
import sys
from collections import deque


def solve():
    input = sys.stdin.readline
    N = int(eval(input()))
    A = [[int(a) for a in input().split()] for _ in range(2)]
    M = ((1, 0), (0, 1))
    q = deque()
    q.append((0, 0, 0))
    C = [[0] * N for _ in range(2)]
    while q:
        i, j, n = q.popleft()
        if n + A[i][j] > C[i][j]:
            C[i][j] = n + A[i][j]
            for di, dj in M:
                if 0 <= i + di < 2 and 0 <= j + dj < N:
                    q.append((i + di, j + dj, C[i][j]))
    print((C[1][N - 1]))
    return 0


if __name__ == "__main__":
    solve()

import sys


def solve():
    input = sys.stdin.readline
    N = int(eval(input()))
    A = [[int(a) for a in input().split()] for _ in range(2)]
    first = [0] * N
    second = [0] * N
    first[0] = A[0][0]
    second[N - 1] = A[1][N - 1]
    for i in range(1, N):
        first[i] = first[i - 1] + A[0][i]
        second[N - 1 - i] = second[N - i] + A[1][N - 1 - i]
    maxPoint = 0
    for i in range(N):
        maxPoint = max(maxPoint, first[i] + second[i])
    print(maxPoint)
    return 0


if __name__ == "__main__":
    solve()

-from collections import deque -    M = ((1, 0), (0, 1)) -    q = deque() -    q.append((0, 0, 0)) -    C = [[0] * N for _ in range(2)] -    while q: -        i, j, n = q.popleft() -        if n + A[i][j] > C[i][j]: -            C[i][j] = n + A[i][j] -            for di, dj in M: -                if 0 <= i + di < 2 and 0 <= j + dj < N: -                    q.append((i + di, j + dj, C[i][j])) -    print((C[1][N - 1])) +    first = [0] * N +    second = [0] * N +    first[0] = A[0][0] +    second[N - 1] = A[1][N - 1] +    for i in range(1, N): +        first[i] = first[i - 1] + A[0][i] +        second[N - 1 - i] = second[N - i] + A[1][N - 1 - i] +    maxPoint = 0 +    for i in range(N): +        maxPoint = max(maxPoint, first[i] + second[i]) +    print(maxPoint)