let split_string ?(pattern="") = Str.split @@ Str.regexp pattern
let n = Scanf.sscanf (read_line ()) "%d" @@ fun n -> n
let a = Array.init 2 @@ fun _ -> read_line () |> split_string ~pattern:" " |> List.map int_of_string |> Array.of_list

let () =
  for i = 1 to n - 1 do a.(0).(i) <- a.(0).(i - 1) + a.(0).(i) done;
  a.(1).(0) <- a.(1).(0) + a.(0).(0);
  for i = 1 to n - 1 do a.(1).(i) <- max a.(0).(i) a.(1).(i - 1) + a.(1).(i) done;
  Printf.printf "%d\n" a.(1).(n - 1)