import Data.Maybe
readInt :: String -> Int
readInt = read

main = do
 _ <- getLine
 arr <- (map readInt . words) <$> getLine
 let anss = foldr foo' [(2,2,1)] arr
 if null anss then print(-1) 
  else do
   let (a,_,_) = head anss
   let (_,b,_) = last anss
   putStrLn(show a++" "++show b)

type Cand = [Int]

type Range = (Int,Int,Int) -- [a,b,step]

type Cand' = [Range]

filterRange :: Int -> Range -> Maybe Range
filterRange divisor (a,b,step) = case ([q | q <- take divisor [a,a+step..], q `mod` divisor == 0], [q | q <- take divisor [b,b-step..], q `mod` divisor == 0]) of
 ([],_) -> Nothing
 (c:_,d:_) -> Just (c,d,divisor)

toList :: Range -> [Int]
toList (a,b,step) = [a,a+step..b]

foo' :: Int -> Cand' -> Cand'
foo' divisor cand = [(c,c+divisor-1,1) | c <- concatMap toList newcand]
 where newcand = mapMaybe (filterRange divisor) cand

-- reverse action
foo :: Int -> Cand -> Cand
foo divisor cand = [ c+rem | c <- newcand, rem <- [0..divisor-1] ]
 where newcand = [c | c <- cand, c `mod` divisor == 0]