import numpy as np

n = int(eval(input()))

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

na = np.array(a)



top_sum = na[0].cumsum()

under_sum = na[1][::-1].cumsum()[::-1]



amount = [top_sum[i] + under_sum[i] for i in range(n)]

print((max(amount))) 
def main():

    n = int(eval(input()))

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

    print((problem087c(n, a)))



def problem087c(n, a):

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

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

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

    for i in range(n - 1):

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

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

    return max([dp[0][n - 1], dp[1][n - 1]])

main()
import numpy as np

n = int(eval(input()))
a = [list(map(int, input().split())) for _ in range(2)]
na = np.array(a)
top_sum = na[0].cumsum()
under_sum = na[1][::-1].cumsum()[::-1]
amount = [top_sum[i] + under_sum[i] for i in range(n)]
print((max(amount)))

def main():
    n = int(eval(input()))
    a = [list(map(int, input().split())) for _ in range(2)]
    print((problem087c(n, a)))


def problem087c(n, a):
    dp = [[0 for _ in range(n)] for _ in range(2)]
    dp[0][0] = a[0][0]
    dp[1][0] = dp[0][0] + a[1][0]
    for i in range(n - 1):
        dp[0][i + 1] += dp[0][i] + a[0][i + 1]
        dp[1][i + 1] = max([dp[1][i] + a[1][i + 1], dp[0][i + 1] + a[1][i + 1]])
    return max([dp[0][n - 1], dp[1][n - 1]])


main()

-import numpy as np +def main(): +    n = int(eval(input())) +    a = [list(map(int, input().split())) for _ in range(2)] +    print((problem087c(n, a))) -n = int(eval(input())) -a = [list(map(int, input().split())) for _ in range(2)] -na = np.array(a) -top_sum = na[0].cumsum() -under_sum = na[1][::-1].cumsum()[::-1] -amount = [top_sum[i] + under_sum[i] for i in range(n)] -print((max(amount))) + +def problem087c(n, a): +    dp = [[0 for _ in range(n)] for _ in range(2)] +    dp[0][0] = a[0][0] +    dp[1][0] = dp[0][0] + a[1][0] +    for i in range(n - 1): +        dp[0][i + 1] += dp[0][i] + a[0][i + 1] +        dp[1][i + 1] = max([dp[1][i] + a[1][i + 1], dp[0][i + 1] + a[1][i + 1]]) +    return max([dp[0][n - 1], dp[1][n - 1]]) + + +main()