let () =
  let n = Scanf.scanf "%d\n" (fun n -> n) in
  let ue = Array.init n (fun _ -> Scanf.scanf "%d " (fun a -> a)) in
  let shita = Array.init n (fun _ -> Scanf.scanf "%d " (fun a -> a)) in
  for i = 1 to n - 1 do
    ue.(i) <- ue.(i) + ue.(i - 1)
  done;
  for i = n - 2 downto 0 do
    shita.(i) <- shita.(i) + shita.(i + 1)
  done;
  Array.init n (fun i -> ue.(i) + shita.(i))
  |> Array.fold_left max 0
  |> Printf.printf "%d\n"