import Control.Applicative

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