program main
	implicit none
    integer::n,i,j
    integer,allocatable::a(:),b(:),c(:,:)
    read(*,*) n
    allocate(a(n))
    allocate(b(n))
    read(*,*) a
    read(*,*) b
    allocate(c(2,n))
    c(1,1)=a(1)
    do j=2,n
        c(1,j)=c(1,j-1)+a(j)
    end do
    c(2,1)=a(1)+b(1)
    do i=2,n
    	c(2,i)=max(c(1,i),c(2,i-1))+b(i)
    end do
    write(*,*) c(2,n)
    deallocate(a)
    deallocate(b)
    deallocate(c)
    stop
end program main


