import Control.Applicative

main :: IO()
main = do
    _ <- getLine
    l <- map read . words <$> getLine
    putStrLn $ calcAns (reverse l) [2]
        where
            calcAns _ [] = "-1"
            calcAns (a:b:rest) ns = calcAns (b:rest) [n+k | n <- ns, k <- [0..a-1], mod (n+k) b == 0]
            calcAns [a] ns = show (minimum ns) ++ ' ' : show (maximum ns + a - 1)