program candy
  implicit none
  integer::n, i, c, cmax
  integer,allocatable::a(:,:)

  read(*,*) n
  allocate(a(n,2))

  read(*,*) (a(i,1), i = 1, n)
  read(*,*) (a(i,2), i = 1, n)

  cmax = 0
  
  do i = 1, n
     c = sum(a(1:i,1:1))+sum(a(i:n,2:2))
     if ( c > cmax) then
        cmax = c
     end if
  end do
  
  write(*,*) cmax
  
  stop
end program candy
