#include<stdio.h>
int main(void){
  char *s="python3 -c\""
"from fractions import*\n"
"n,*a=map(int,open(0).read().split())\n"
"*b,=a=a+[0]\n"
"r=range(n)\n"
"for i in r:a[i]=gcd(a[i],a[i-1]);b[n-i-1]=gcd(b[n-i-1],b[n-i])\n"
"print(max(gcd(a[i-1],b[i+1])for i in r))\n"
"\"";
  system(s);
  return 0;
}            