import Control.Applicative

main :: IO()
main = do
    _ <- getLine
    l <- reverse . map read . words <$> getLine
    putStrLn $ calcAns l (2,2)
        where
            calcAns _ (l,r) | l > r = "-1"
            calcAns [a] (l,r) = show l ++ ' ' : show (r + a - 1)
            calcAns (a:b:rest) lr
                | mod a b == 0 = calcAns (a:rest) lr
                | mod b a == 0 = calcAns (b:rest) lr
            calcAns (a:as) (l,r) = calcAns as ((l - 1) `div` a * a + a, r `div` a * a + a - 1)
