'use strict'

const input = require('fs').readFileSync('/dev/stdin', 'utf8')
const inputs = input.split(/\s/)[Symbol.iterator]()

const N = +inputs.next().value
const A = [...inputs].map((a) => +a)
const max = Math.max(...A)

// console.log(N)
// console.log(A)
// console.log(max)

function gcd(nums) {
  // console.log(nums)
  const a = nums[0]
  const b = nums[1]
  // const [a, b] = nums
  if (b === 0) return a
  if (a === 1 || b === 1) return 1

  if (nums.length > 2) gcd([nums[0], gcd(nums.slice(1))])

  return gcd([b, a % b])
}

const cases = []
for (let i = 0; i < N; i++) {
  cases.push([...A]) // copy and push A
}

const gcdList = cases
  .map((nums, index) => {
    const temp = [...nums]
    temp.splice(index, 1, max)
    return temp
  })
  // .map((nums) => {
  //   console.log(nums)
  //   return nums
  // })
  .map((nums) => gcd(nums))

const maxGcd = Math.max(...gcdList)

console.log(maxGcd)
