{-# OPTIONS_GHC -O #-}

import Control.Monad
import Data.List
import qualified Data.ByteString.Char8 as B

main = do
    n<-readLn :: IO Int
    (a:a1s) <- unfoldr (B.readInt.B.dropWhile (==' ')) <$> B.getLine
    a2s <- unfoldr (B.readInt.B.dropWhile (==' ')) <$> B.getLine
    --
    print $ (\(a,b) -> max a b) $ solve a a a1s a2s

solve :: Int -> Int -> [Int] -> [Int] -> (Int,Int)
solve a b [] (l:_) = (a+l,b+l)
solve a b (a1:a1s) (b1:b1s) = solve (a+a1) (max (a+b1) (b+b1)) a1s b1s
