$Gogi$, $Tapu$ and $Sonu$ are the elite members of $Tapu$ $Sena$. $Gogi$ is always stoned and asks absurd questions, But this time he asked a question which seems to be very serious and interesting. $Tapu$ wants to solve this question to impress $Sonu$. He  gave an array of length N to $Tapu$, $Tapu$ can perform the following operations exactly once:
- Remove any subarray from the given array given the resulting array formed after the removal is non-empty.    
- Reverse the whole array.
Remember you can’t shuffle the elements of the array.
Tapu needs to find out the maximum possible GCD of all the numbers in the array after applying the given operations exactly once. Tapu is very weak at programming, he wants you to solve this problem so that he can impress $Sonu$.

-----Input:-----
- The first line contains $T$, the number of test cases.
- For each test case
-FIrst line contains $N$.
- Last line contains $N$ numbers of the array. 

-----Output:-----
A single integer in a new line, maximum possible GCD. 

-----Constraints-----
- $1 \leq T \leq 10^2$
- $1 \leq N \leq 10^4$
- $1 \leq a[i] \leq 10^9$

Summation of N for all testcases is less than $10^6$ 

-----Sample Input 1:-----
1
1
2

-----Sample Output 1:-----
2

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = "# cook your dish here\nfrom math import gcd\nst=''\ndef func(n,l1):\n    if n==1:\n        return l1[0]\n    elif n==2:\n        return gcd(l1[0],l1[1])\n    p=l1[0]\n    m=p\n    for i in range(1,n):\n        g=gcd(p,l1[i])\n        m=max(m,g)\n        p=g\n    p=l1[-1]\n    m=max(m,p)\n    for i in range(n-2,0,-1):\n        g=gcd(l1[i],p)\n        m=max(m,g)\n        p=g\n    return m\n\n\n\nfor _ in range(int(input())):\n    #a,b=map(str,input().split())\n    n = int(input())\n    #s=input()\n    l1=list(map(int,input().split()))\n    #l2 = list(map(int, input().split()))\n    #l1=input().split()\n    #l2=input().split()\n    st+=str(func(n,l1))+'\\n'\n\nprint(st)\n'''\n\n'''"
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13183