program sample
  implicit none
  integer :: n,i
  integer,allocatable :: a1(:),a2(:),s(:)
  read(*,*) n
  allocate(a1(n))
  allocate(a2(n))
  allocate(s(n))
  read(*,*) a1
  read(*,*) a2

  do i=1,n
     s(i)=sum(a1(1:i))+sum(a2(i:n))
  enddo
  write(*,*) maxval(s)
  
end program sample