f :: String->[Int]
f x=map read (words x)::[Int]

f2::[Int]->[Int]->Int->Int
f2 [] _ ans=ans
f2 (x:xs) (x2:xs2) ans=f2 xs xs2 (max (ans+x2) (x+x2))
                  

main = do
        e <- getLine
        e1 <- getLine
        e2 <- getLine
        let xs=f e1
            xs2=f e2
            zs=scanl1 (+) xs
        putStrLn $ show $ f2 zs xs2 0