object Main extends App {
  
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt()
  val a = Array.fill(2)(Array.fill(n)(sc.nextInt()))
  val ans = for(i <- 0 until n) yield {
    a(0).slice(0,i+1).sum + a(1).slice(i,n).sum
  }
  println(ans.max)
}
