There are N integers, A_1, A_2, ..., A_N, written on the blackboard.

You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.

Find the maximum possible greatest common divisor of the N integers on the blackboard after your move.

Constraints

* All values in input are integers.
* 2 \leq N \leq 10^5
* 1 \leq A_i \leq 10^9

Output

Input is given from Standard Input in the following format:


N
A_1 A_2 ... A_N

Output

Print the maximum possible greatest common divisor of the N integers on the blackboard after your move.

Examples

Input

3
7 6 8


Output

2


Input

3
12 15 18


Output

6


Input

2
1000000000 1000000000


Output

1000000000

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		int a[] = new int[100001];

		for(int i = 0; i < n; i++){
			a[i] = sc.nextInt();
		}

		int SEG_SIZE = 100;
		int seg[] = new int[a.length/SEG_SIZE];
		int gcdInSegWithout[] = new int[100001];

		for(int i = 0; i < n; i += SEG_SIZE){
			int tmpgcd = a[i];

			int segID = i / SEG_SIZE;
			for(int j = 0; j < SEG_SIZE; j++){
				if(segID*SEG_SIZE + j >= n){
					break;
				}


				tmpgcd = gcd(a[segID*SEG_SIZE + j], tmpgcd);
			}
			seg[segID] = tmpgcd;
		}
//
//		for(int i = 0; i < 10; i++){
//			System.out.print(seg[i]+" ");
//		}
//		System.out.println();

		for(int i = 0; i < n; i ++){
			int tmpgcd = 0;

			int segID = i / SEG_SIZE;
			for(int j = 0; j < SEG_SIZE; j++){
				if(segID*SEG_SIZE + j >= n){
					break;
				}

				if(segID*SEG_SIZE + j == i){
					continue;
				}

				if(tmpgcd == 0){
					tmpgcd = a[segID*SEG_SIZE + j];
				}
				else {
					tmpgcd = gcd(a[segID*SEG_SIZE + j], tmpgcd);
				}
			}
			gcdInSegWithout[i] = tmpgcd;
		}
//		for(int i = 0; i < 10; i++){
//			System.out.print(gcdInSegWithout[i]+" ");
//		}
//		System.out.println();

		int result = 0;
		for(int i = 0; i < n; i++){

			int segID = i / SEG_SIZE;
			int tmpgcd = gcdInSegWithout[i];

			for(int j = 0; j < seg.length; j++){
				if(j == segID || seg[j] == 0){
					continue;
				}

				if(tmpgcd == 0){
					tmpgcd = seg[j];
				}
				else {
					tmpgcd = gcd(tmpgcd, seg[j]);
				}
			}

			result = Math.max(result, tmpgcd);
		}

		System.out.println(result);

	}

	static int gcd(int a, int b){
    	int tmp;

    	while (a % b != 0)
    	{
    		tmp = b;
    		b = a % b;
    		a = tmp;
    	}
    	return b;
    }
}
