main=do
 n<-readLn;a<-map read.words<$>getLine
 print((maximum.map (\(a,b)->gcd a b))(zip (reverse(f n (reverse a) (product a))) (f n a (product a))))
  where f 0 _ _ = []
        f n (b:a) g= g:(f(n-1)a(gcd g b))