module Main where
import Data.List(zipWith)
int = read :: String -> Int
replace pred a = map (\x -> if pred x then a else x)
main = interact $ printer . solver . parser
parser = map (map int . words) . lines
printer = unlines . (:[]) . show

solver :: [[Int]] -> Int
solver [ns,a1,a2] = last b2 
  where
    n = head ns :: Int
    b1 = scanl1 (+) a1 :: [Int]
    b2 = tail $ scanl (\n (b,a)-> a + max n b) 0 $ zip b1 a2 :: [Int]