#!/usr/bin/env python3

import sys





def dfs(x:int, y:int):

    

    if(y == 1 and x == (N-1)):

        return A[y][x]



    elif(y > 1 or x > N-1):

        return 0

    else:

        return max(dfs(x+1, y), dfs(x, y+1)) + A[y][x]

    

    

def solve(N: int, A: "List[List[int]]"):

    print((dfs(0,0)))

    return





# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)

def main():

    def iterate_tokens():

        for line in sys.stdin:

            for word in line.split():

                yield word

    tokens = iterate_tokens()

    global N, A

    N = int(next(tokens))  # type: int

    A = [[int(next(tokens)) for _ in range(N)] for _ in range(2)]  # type: "List[List[int]]"

    solve(N, A)



if __name__ == '__main__':

    main()

#!/usr/bin/env python3

import sys





def solve(N: int, A: "List[List[int]]"):

    ans = 0

    for i in range(0,N):

        ans = max(sum(A[0][:i+1])+sum(A[1][i:]), ans)



    print(ans)



    return





# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)

def main():

    def iterate_tokens():

        for line in sys.stdin:

            for word in line.split():

                yield word

    tokens = iterate_tokens()

    N = int(next(tokens))  # type: int

    A = [[int(next(tokens)) for _ in range(N)] for _ in range(2)]  # type: "List[List[int]]"

    solve(N, A)



if __name__ == '__main__':

    main()

#!/usr/bin/env python3
import sys


def dfs(x: int, y: int):
    if y == 1 and x == (N - 1):
        return A[y][x]
    elif y > 1 or x > N - 1:
        return 0
    else:
        return max(dfs(x + 1, y), dfs(x, y + 1)) + A[y][x]


def solve(N: int, A: "List[List[int]]"):
    print((dfs(0, 0)))
    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    global N, A
    N = int(next(tokens))  # type: int
    A = [
        [int(next(tokens)) for _ in range(N)] for _ in range(2)
    ]  # type: "List[List[int]]"
    solve(N, A)


if __name__ == "__main__":
    main()

#!/usr/bin/env python3
import sys


def solve(N: int, A: "List[List[int]]"):
    ans = 0
    for i in range(0, N):
        ans = max(sum(A[0][: i + 1]) + sum(A[1][i:]), ans)
    print(ans)
    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [
        [int(next(tokens)) for _ in range(N)] for _ in range(2)
    ]  # type: "List[List[int]]"
    solve(N, A)


if __name__ == "__main__":
    main()

-def dfs(x: int, y: int): -    if y == 1 and x == (N - 1): -        return A[y][x] -    elif y > 1 or x > N - 1: -        return 0 -    else: -        return max(dfs(x + 1, y), dfs(x, y + 1)) + A[y][x] - - -    print((dfs(0, 0))) +    ans = 0 +    for i in range(0, N): +        ans = max(sum(A[0][: i + 1]) + sum(A[1][i:]), ans) +    print(ans) -    global N, A