program abc087c
  implicit none
  integer :: n, i
  integer,dimension(:),allocatable :: u, l
  read *, n
  allocate(u(n),l(n))
  read *, u, l
  do i = 2,n
     u(i) = u(i)+u(i-1)
  end do
  do i = n-1,1,-1
     l(i) = l(i)+l(i+1)
  end do
  print *, maxval(u+l)
end program abc087c
