
open Scanf
open Printf

let rec for_iter a b f = if a >= b then () else (f a; for_iter (a+1) b f)
let rec for_iterr a b f = if a <= b then () else (f a; for_iter (a-1) b f)
let rec for_iters a b s f = if (a-b >= 0) <> (s >= 0) then () else (f a; for_iter (a+s) b f)

let read_int () = scanf " %d" (fun x -> x)
let rec read_ints n = if n = 0 then [] else let i = read_int () in i :: read_ints (n-1)
let read_ints_arr n = Array.init n (fun _ -> read_int ())
let read_ints_arr_ref n = Array.init n (fun _ -> ref (read_int ()))

let accum xs =
  let rec f ys ac =
    match ys with
    | [] -> []
    | (y::ys') -> (y+ac) :: f ys' (y+ac)
  in f xs 0

let () =
  let n = read_int () in
  let x0 = read_ints n |> accum in
  let x1 = read_ints n |> List.rev |> accum |> List.rev in
  let ans = List.fold_left2 (fun c a b -> max c (a+b)) 0 x0 x1 in
  printf "%d\n" ans
