program prob1
    implicit none
    integer(8)::N, i, j, ans, candy
    integer, allocatable::A(:), B(:), Asum(:), Bsum(:)
    read(*,*) N
    allocate(A(N))
    allocate(B(N))
    allocate(Asum(N))
    allocate(Bsum(N))
    read(*,*) A
    read(*,*) B
    Asum(1) = A(1)
    Bsum(1) = B(1)
    ans = sum(B) + A(1)

    if(N == 1) then
        write(*,*) ans
    else
        do i = 2, N
            Asum(i) = Asum(i-1) + A(i)
            Bsum(i) = Bsum(i-1) + B(i)
        end do

        do i = 2, N
            candy = Asum(i) + sum(B) - Bsum(i-1)
            if(candy > ans) then
                ans = candy
            end if
        end do
        write(*,*) ans
    end if

    deallocate(A)
    deallocate(B)
    deallocate(Asum)
    deallocate(Bsum)
    stop
end program prob1