Tara was completing an Algorithms assignment and got stuck on a question. She thought of who can help her, and got reminded of Kabir who has good problem solving skills. The question is:
Given N$N$ the number of elements in the sequence A1$A_1$,A2$A_2$ … An$A_n$. Find out the prime factor which occurred maximum number of times among the largest prime factor corresponding to each element. if there are more than one such prime factors print the largest one.
You are friends with Kabir, help him to solve the problem for Tara.

-----Input:-----
- The first line of the input contains a single integer T$T$ denoting the number of test cases. The description of T test cases follows. 
- First line of each test case contains N$N$, the number of elements in the sequence.
- Second line contains N space separated elements A1$A_1$,A2$A_2$ … An$A_n$.

-----Output:-----
- For each test case, print a single line, the number which occurs maximum number of times from the largest prime factor corresponding to each element.

-----Constraints-----
- 1≤T≤10$1 \leq T \leq 10$
- 1≤N≤105$1 \leq N \leq 10^5$
- 2≤A[i]≤105$2 \leq A[i] \leq 10^5$

-----Sample Input:-----
1
7

3 2 15 6 8 5 10

-----Sample Output:-----
5

-----EXPLANATION:-----
The largest prime factors of numbers are:
3 2  5  3  2  5  5 , of which 5 is most frequent.

```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 collections import Counter\n\n\n# Python3 program to find prime factorization \n# of a number n in O(Log n) time with \n# precomputation allowed. \nimport math as mt \n\nMAXN = 100001\n\n# stores smallest prime factor for \n# every number \nspf = [0 for i in range(MAXN)] \n\n# Calculating SPF (Smallest Prime Factor) \n# for every number till MAXN. \n# Time Complexity : O(nloglogn) \ndef sieve(): \n    spf[1] = 1\n    for i in range(2, MAXN): \n        \n        # marking smallest prime factor \n        # for every number to be itself. \n        spf[i] = i \n\n    # separately marking spf for \n    # every even number as 2 \n    for i in range(4, MAXN, 2): \n        spf[i] = 2\n\n    for i in range(3, mt.ceil(mt.sqrt(MAXN))): \n        \n        # checking if i is prime \n        if (spf[i] == i): \n            \n            # marking SPF for all numbers \n            # divisible by i \n            for j in range(i * i, MAXN, i): \n                \n                # marking spf[j] if it is \n                # not previously marked \n                if (spf[j] == j): \n                    spf[j] = i \n\n# A O(log n) function returning prime \n# factorization by dividing by smallest \n# prime factor at every step \ndef getFactorization(x): \n    ret = list() \n    while (x != 1): \n        ret.append(spf[x]) \n        x = x // spf[x] \n\n    return ret.pop() #last ele \n\n# Driver code \n\n# precalculating Smallest Prime Factor \nsieve() \n# x = 12246\n\n# calling getFactorization function \n# p = getFactorization(x) \n\n# for i in range(len(p)): \n#     print(p[i], end = " ") \n\n# This code is contributed \n# by Mohit kumar 29 \n\n\n            \nt = int(input())\n\nfor test in range(t):\n    n = int(input())\n    A = tuple(map(int, input().split()))\n    li = []\n    mx = 1\n    mx_li = []\n    for a in A:\n        li.append(getFactorization(a))\n      \n    c = Counter(li)\n    # print(li)\n    # print(c)\n    for key in c:\n        if c[key] > mx:\n            mx_li = [key]\n            mx = c[key]\n        elif c[key] == mx:\n            mx_li.append(key)\n    \n    print(max(mx_li))\n            \n'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 3999190