extension String: CollectionType {}

func gcd(a:Int, b:Int) -> Int {
    if a == b {
        return a
    }
    else {
        if a > b {
            return gcd(a-b,b:b)
        }
        else {
            return gcd(a,b:b-a)
        }
    }
}

let num:Int = Int(readLine()!)!
let arr: [Int] = readLine()!.split(" ").map { Int($0)! }
var c: [Int] = arr

var o = 0
for var i = 0; i < num; i+=1 {
  c.removeAtIndex(i)
  
  var temp = c[0]
  for var j = 0; j < num-1; j+=1 {
    temp = gcd(temp,b:c[j])
  }
  if( temp > o ) {
	o = temp
  }

  c = arr
}

print(o)