program candies
	implicit none
    integer,allocatable :: Masu(:,:)
	integer :: length,num_can,turning,i,j,tmp_can
	
    read(*,*) length
    allocate(Masu(2,length))
    read(*,*) Masu(1,:) 
    read(*,*) Masu(2,:) 
    
    num_can=0
    do turning=1,length
    	tmp_can=0
    	do i=1,turning
        	tmp_can=tmp_can+Masu(1,i)
        end do
        do i=turning,length
        	tmp_can=tmp_can+Masu(2,i)
        end do
        if(num_can.lt.tmp_can) then
        	num_can=tmp_can
        endif
    end do
    write(*,'(i0)') num_can
    deallocate(Masu)

end program candies