p03061 AtCoder Beginner Contest 125 - GCD on Blackboard_28744
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
from fractions import gcd
n=int(input())
a=list(map(int,input().split()))
l=[0]*(n+1)
r=[0]*(n+1)
for i in range(n):
    l[i+1]=gcd(l[i],a[i])
for i in range(n-1,-1,-1):
    r[i]=gcd(r[i+1],a[i])
ans=l[-1]
for i in range(n):
    ans=max(ans,gcd(l[i],r[i+1]))
print(ans)
    
3
7 6 8 2
1000000000 1000000000 3
12 15 18 3
7 6 7 2
1000010000 1000000000 3
12 29 18 2
1000000000 1000001000 3
4 8 7 2
1001000000 1000001000 3
9 28 18 3
9 28 30 2
1001100000 1000001100 2
1101000000 1000001100 3
4 2 5 2
1101100000 1000000100 2
1111100000 1000000100 2
1111101000 1100000100 3
36 36 10 3
53 36 11 2
1111101100 1100101000 2
1111101101 1100101000 2
0111101101 1100101000 3
114 36 12 2
0111101101 1100101010 2
0011101011 1000101000 2
0011101011 1000101001 3
144 24 2 2
0011101011 1100101001 2
1011101011 1100101101 2
1011101011 1101101101 3
32 24 1 2
1011101111 1101111101 2
1011101111 1101111111 2
1011101100 1100111101 2
0001011001 1101101111 2
0001011001 1001101111 2
0011010001 1001101110 2
0011011001 1001101010 2
0011011001 0001101010 2
0011011101 0001101010 2
0011001101 0001101010 2
0111001101 0001101010 2
0111001001 1001100010 2
1111001101 1001100010 2
1110001101 1001100000 2
1110000101 1001100000 2
1110100101 1101101101 2
1110100001 1101101101 2
1110101001 1101101111 2
1001101001 0101101111 2
1001101000 0110101101 2
1101101000 0110101101 2
1101101100 0110101101 2
0101101100 0110101101 2
0110101100 0110101001 2
0110101110 0110001001 2
0010101110 0110001001 2
0010101110 0110001011 2
0010101100 0110101001 2
0010101100 0110100001 2
0010101100 0010100001 2
0000101100 0010100001 2
0000101100 0010100000 2
0000101100 0010100010 2
0000101100 0011100010 2
0010100100 0010100010 2
0010110100 0010100010 2
0010110100 1010100010 2
0010110100 1110100010 2
0010110100 1110100011 2
0010110100 1111100011 2
1010110100 1110100111 2
1010110100 1110101111 2
1010111000 1111101111 2
0000000100 1111100101 2
0001000100 1111000101 2
1011000100 0111000101 2
1111000100 0111000101 2
1111000110 0011000101 2
1111001110 0011000101 2
1110001110 1011000101 2
1110001111 1011000101 2
1111001111 0011000101 2
0111001111 0011000101 2
0001011001 0011000101 2
0001011001 0011000111 2
0001111001 1011000101 2
0001111011 1011100101 2
1010010111 0110000101 2
1010000111 0110001101 2
1000000111 0111001101 2
1001000111 0111001101 2
1001000011 0101001100 2
1000000111 1101001110 2
1000000111 1101011110 2
1000100111 0101011110 2
1000110111 0101011110 2
1000010111 0101001100 2
0000010111 0101001100 2
0001010111 0100001100 2
1001010111 0100001100 2
1001000110 0000011100 2
0001000110 0001001100
2 1000000000 6 7
 1000010000
 6
 1000001000
 4
 1001000000
 9
 3
 1001100000
 1101000000
 2
 1101100000
 1111100000
 1111101000
 36
 1
 1111101100
 1111101101
 1100101000
 12
 1100101010
 1000101000
 1000101001
 24
 1100101001
 1100101101
 1101101101
 8
 1101111101
 1101111111
 1100111101
 1101101111
 1001101111
 1001101110
 1001101010
 11011001
 11011101
 11001101
 111001101
 1001100010
 1111001101
 1110001101
 1110000101
 1110100101
 1110100001
 1110101001
 1001101001
 1001101000
 1101101000
 1101101100
 110101101
 110101100
 110101110
 110001001
 110001011
 110101001
 110100001
 10101100
 10100001
 10100000
 10100010
 11100010
 10100100
 10110100
 1010100010
 1110100010
 1110100011
 1111100011
 1110100111
 1110101111
 1111101111
 1111100101
 1111000101
 1011000100
 1111000100
 1111000110
 1111001110
 1110001110
 1110001111
 1111001111
 111001111
 11000101
 11000111
 1011000101
 1011100101
 1010010111
 1010000111
 1000000111
 1001000111
 1001000011
 1101001110
 1101011110
 1000100111
 1000110111
 1000010111
 101001100
 100001100
 1001010111
 1001000110
 1001100
