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)]

    move = ((1, 0), (0, 1))

    maxN = [[0 for _ in range(N)] for i in range(2)]

    q = deque()

    q.append((0, 0, A[0][0]))

    while q:

        nx, ny, np = q.popleft()

        maxN[nx][ny] = max(maxN[nx][ny], np)

        for dx, dy in move:

            if 0 <= nx + dx < 2 and 0 <= ny + dy < N:

                q.append((nx + dx, ny + dy, maxN[nx][ny] + A[nx + dx][ny + dy]))

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





    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
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)]
    move = ((1, 0), (0, 1))
    maxN = [[0 for _ in range(N)] for i in range(2)]
    q = deque()
    q.append((0, 0, A[0][0]))
    while q:
        nx, ny, np = q.popleft()
        maxN[nx][ny] = max(maxN[nx][ny], np)
        for dx, dy in move:
            if 0 <= nx + dx < 2 and 0 <= ny + dy < N:
                q.append((nx + dx, ny + dy, maxN[nx][ny] + A[nx + dx][ny + dy]))
    print((maxN[1][N - 1]))
    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()

-    move = ((1, 0), (0, 1)) -    maxN = [[0 for _ in range(N)] for i in range(2)] +    M = ((1, 0), (0, 1)) -    q.append((0, 0, A[0][0])) +    q.append((0, 0, 0)) +    C = [[0] * N for _ in range(2)] -        nx, ny, np = q.popleft() -        maxN[nx][ny] = max(maxN[nx][ny], np) -        for dx, dy in move: -            if 0 <= nx + dx < 2 and 0 <= ny + dy < N: -                q.append((nx + dx, ny + dy, maxN[nx][ny] + A[nx + dx][ny + dy])) -    print((maxN[1][N - 1])) +        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]))