from sys import stdin

def main():

    #入力

    readline=stdin.readline

    N=int(readline())

    A=[]

    for i in range(2):

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

        A.append(li)

    

    up=[0]*N

    up[0]=A[0][0]

    down=[0]*N

    down[-1]=A[1][-1]

    for i in range(1,N):

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

    for i in range(N-2,-1,-1):

        down[i]+=down[i+1]+A[1][i]



    res=0

    for i in range(N):

        res=max(res,up[i]+down[i])



    print(res)

    

if __name__=="__main__":

    main()
from sys import stdin

def main():

    #入力

    readline=stdin.readline

    n=int(readline())

    a=list(map(int,readline().split()))

    b=list(map(int,readline().split()))

    for i in range(1,n):

        a[i]+=a[i-1]

    for i in range(n-2,-1,-1):

        b[i]+=b[i+1]



    ans=0

    for i in range(n):

        ans=max(ans,a[i]+b[i])



    print(ans)



if __name__=="__main__":

    main()
from sys import stdin


def main():
    # 入力
    readline = stdin.readline
    N = int(readline())
    A = []
    for i in range(2):
        li = list(map(int, readline().split()))
        A.append(li)
    up = [0] * N
    up[0] = A[0][0]
    down = [0] * N
    down[-1] = A[1][-1]
    for i in range(1, N):
        up[i] += up[i - 1] + A[0][i]
    for i in range(N - 2, -1, -1):
        down[i] += down[i + 1] + A[1][i]
    res = 0
    for i in range(N):
        res = max(res, up[i] + down[i])
    print(res)


if __name__ == "__main__":
    main()

from sys import stdin


def main():
    # 入力
    readline = stdin.readline
    n = int(readline())
    a = list(map(int, readline().split()))
    b = list(map(int, readline().split()))
    for i in range(1, n):
        a[i] += a[i - 1]
    for i in range(n - 2, -1, -1):
        b[i] += b[i + 1]
    ans = 0
    for i in range(n):
        ans = max(ans, a[i] + b[i])
    print(ans)


if __name__ == "__main__":
    main()

-    N = int(readline()) -    A = [] -    for i in range(2): -        li = list(map(int, readline().split())) -        A.append(li) -    up = [0] * N -    up[0] = A[0][0] -    down = [0] * N -    down[-1] = A[1][-1] -    for i in range(1, N): -        up[i] += up[i - 1] + A[0][i] -    for i in range(N - 2, -1, -1): -        down[i] += down[i + 1] + A[1][i] -    res = 0 -    for i in range(N): -        res = max(res, up[i] + down[i]) -    print(res) +    n = int(readline()) +    a = list(map(int, readline().split())) +    b = list(map(int, readline().split())) +    for i in range(1, n): +        a[i] += a[i - 1] +    for i in range(n - 2, -1, -1): +        b[i] += b[i + 1] +    ans = 0 +    for i in range(n): +        ans = max(ans, a[i] + b[i]) +    print(ans)