(defn create-data [s]
  (map #(Long/parseLong %) (.split s " ")))

(defn sum [xs]
  (reduce + xs))

(defn zip [xs ys]
  (map vector xs ys))

(defn candies3 [n ys1 ys2]
  (->> (zip
        (reductions + ys1)
        (reductions - (sum ys2) ys2))
       (map sum)
       (apply max)))

(println (candies3 (Long/parseLong (read-line)) (create-data (read-line)) (create-data (read-line))))
