Processing math: 100%
Maximum GCD - MarisaOJ: Marisa Online Judge

Maximum GCD

Time limit: 1000 ms
Memory limit: 256 MB

Given an array A of n integers. Find the maximum value of GCD(Ai,Aj) with 1≤i<j≤n.

Input

  • The first line contains an integer n.
  • The next line contains n integers Ai.

Output

  • Print the maximum value of GCD(Ai,Aj).

Constraints

  • 2≤n≤105.
  • 1≤Ai≤106.

Example

Input:

4
3 6 5 2

Output:

3