program main
    implicit none
    integer :: N, A(100,2)
    integer tmp,max,i,j

    write(*,*) N
    write(*,*) A(1:N,1)
    write(*,*) A(1:N,2)

    max=0
    do i=2,N-1
        tmp=0
        do j = 2,i
            tmp = tmp+A(j,1)
        enddo
        do j=i,N-1
            tmp = tmp+A(j,2)
        enddo

        if(tmp>max) max=tmp
    enddo

    max=max+A(1,1)+A(N,2)
    write(*,*) max

end program