process.stdin.resume();
process.stdin.setEncoding('utf8'); 
var lines = [];
var reader = require('readline').createInterface({
	input: process.stdin,
	output: process.stdout
});
 
reader.on('line', (line) => {
	lines.push(line);
});

reader.on('close', () => {
	"use strict"
	const N = +lines[0];
	const A = lines[1].split(" ").map(Number);
	
	const ans = A.map((e, i) => A.filter((e, j) => i!=j).reduce(GCD)).reduce((x,y) => Math.max(x,y));
	console.log(ans);
});

function GCD(n, m){
	const l = Math.max(n, m);
	const s = Math.min(n, m);
	if(l%s) {
		return GCD(s, l%s);
	} else {
		return s;
	}
}