'use strict'
const gcd = (arr) => {
  const f = (a, b) => b ? f(b, a % b) : a
  let ans = arr[0]
  for (var i = 1; i < arr.length; i++) {
      ans = f(ans, arr[i])
  }
  return ans
}
const convertNum = num => Number(num)
const Main = input => {
  const count = Number(input[0])
  const nums = input[1].split(' ').map(convertNum)
  let result = 0
  for (let i = 0; i < count; i++ ) {
    const tmpResult = gcd(nums.filter((num, idx) => idx !== i))
    result = result < tmpResult ? tmpResult : result
  }
  console.log(result)
}
Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n/))