program probC
  implicit none
  integer*8,allocatable :: ame(:,:)
  integer*8 N,j,tot,tmp

  read(*,*) N
  allocate(ame(1:n,2))
  ame=0

  read(*,*) ame(1:n,1)
  read(*,*) ame(1:n,2)


  tot=0
  tmp=0
  
  do j=1,n
     tmp=sum(ame(1:j,1))+sum(ame(j:n,2))
     if(tot<tmp) tot=tmp
  end do
  
  write(*,*) tot
  
end program probC
