#include <bits/stdc++.h>

using namespace std;

int main(){
	int n; cin >> n;
	vector <int> a(n);
	for(int i = 0;i < n;i++){
		cin >> a[i];
	}
	int gcf = -1;
	if(n == 2) return cout << a[0], 0;
	for(int i = 0;i < n;i++){
		int cnt = 0;
		for(int j = 0;j < n;j++){
			if(j == i) continue;
			cnt = __gcd(a[j], cnt);
		}
		gcf = max(gcf, cnt);
	}
	cout << gcf;
	return 0;
}