import qualified Data.ByteString.Char8 as BC
import qualified Data.Sequence as S
import qualified Data.IntMap as M
import Data.Maybe (fromJust)
import Data.List

main = do
  k <- readLn :: IO Int
  a <- map bsToInt . BC.words . BC.reverse <$> BC.getLine
  let ans = solve a (2, 2)
  if ans == Nothing
    then print $ negate 1
    else let (l, r) = fromJust ans
         in putStrLn $ show l ++ " " ++ show r

solve :: [Int] -> (Int, Int) -> Maybe (Int, Int)
solve [] (l, r) = Just (l, r)
solve (a:as) (l, r)
  | l <= a && a <= r = solve as (a, a*2-1)
  | a < l = let m = div l a
                n = div r a
            in if mod l a == 0
                 then solve as (a*m, a*(n+1)-1)
                 else solve as (a*(m+1), a*(n+1)-1)
  | otherwise = Nothing

bsToInt :: BC.ByteString -> Int
bsToInt = fst . fromJust . BC.readInt
