//$ node 181222B.js < 181222B.txt
function Main(input) {
  input = input.split('\n') // 1行目がinput[0], 2行目がinput[1], …に入る
  for(var i=0;i<input.length;i++){
    var tmp = input[i].split(' ')
    input[i] = []
    for(var ii=0;ii<tmp.length;ii++){
      input[i].push(tmp[ii] * 1)
    }
  }
  var ans = 0
////////////////////////////////////////
function makeSaidaikouyakusuu (h){
  var t = 0
  for(var i=1;i<h.length;i++){
    var a = i==1?h[0]:t
    var b = h[i]
    if(a<b){
      var g = b
      b = a
      a = g
    }
    var c = a%b
    if(c==0){
      t=b
      continue
    }
    while(c!=0){
      c = a%b
      if(c!=0){
        a = b
        b = c
      }else{
        t = b
        break
      }
    }
  }
  return t
}


  var inp = []
  for(var j=0;j<input[1].length;j++){
    inp.push(input[1][j])
  }

  if(inp.length==2){
    ans = makeSaidaikouyakusuu(inp)
  }else{
    for(var j=0;j<inp.length;j++){
      var newarray = []
      for(var jj=0;jj<inp.length;jj++){
        newarray.push(inp[jj])
      }
      newarray.splice(j,1)
//      console.log(newarray)
      var tmp = makeSaidaikouyakusuu(newarray)
//      console.log(tmp)
      if(ans<tmp)ans=tmp
    }
    
  }

////////////////////////////////////////
  console.log(ans)
}

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