import Data.Array.Unboxed                                                                                                                             
import Data.List                                                                                                                                      
                                                                                                                                                      
main :: IO ()                                                                                                                                         
main = do                                                                                                                                             
  n <- readLn :: IO Int                                                                                                                               
  as <- map (listArray (0,n-2)) . filter (\x -> length x == n-1) . subsequences . map read . words <$> getLine :: IO [UArray Int Int]                 
  let (l:ls) = group . sort . map (\x -> solve x 1 (n-1)) $ as                                                                                        
  print $ if null ls then head l else head . head $ ls                                                                                                
                                                                                                                                                      
                                                                                                                                                      
solve :: UArray Int Int -> Int -> Int -> Int                                                                                                          
solve xa l r                                                                                                                                          
  | l == r     = xa ! (l-1)                                                                                                                           
  | l == r + 1 = gcd (xa ! (l-1)) (xa ! (r-1))                                                                                                        
  | otherwise  = gcd (solve xa l m) (solve xa (m + 1) r)                                                                                              
  where m = (l + r)`div`2