'use strict'

function Main(input) {
    input = input.split("\n")
    const numbers = input[1].split(' ').map(str => parseInt(str, 10))

    const gcd = (x, y) => {
      while(y) {
        var t = y;
        y = x % y;
        x = t;
      }
      return x;      
    }

    const arrayGcd = (arr) => {
      return arr.reduce((a, b) => {
        return gcd(a, b)
      })
    }

    const gcds = numbers.map((val, i, arr) => {
      let tempArr = arr.filter((elem, j) => {
        return j !== i
      })
      return arrayGcd(tempArr)
    }) 
    
    console.log(Math.max(...gcds))
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"))