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

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

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

        if(tmp>max) max=tmp
    enddo

    write(*,*) max

end program