function main(input) {
	var nums = input.split("\n")[1].split(" ");
	var result = 0;
	var tmp = 0;
	nums.forEach((num, index) => {
		for(var i = index+1; i < nums.length; i ++) {
			tmp = koyaku(+num, +nums[i]);
			if(result < tmp) {
				result = tmp;
			}
		}
	})
	console.log(result);
}
function koyaku(x, y) {
	var tmp1, tmp2;
	if(x > y) {
		tmp1 = x;
		tmp2 = y;
	} else {
		tmp1 = y;
		tmp2 = x;
	}
	if(tmp1 !== tmp2 && tmp1 % tmp2 !== 0) {
		return koyaku(tmp1, tmp1 % tmp2);
	} else {
		return tmp2;
	}
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));