G. Eridanus Prime
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Eridanus Prime is preparing $$$N$$$ transport ships for an Imperial contract, where the $$$i$$$-th ship has a cargo capacity of $$$A_i$$$.

You must design a standardized shipping crate of length $$$x$$$. To maintain structural stability during hyperspace, a ship can only be deployed if its cargo bay is filled perfectly with these crates—meaning the capacity $$$A_i$$$ must be a multiple of the crate size $$$x$$$.

To ensure safety, each vessel is permitted to carry at most one Unstable Coaxium Core. Due to its volatile nature, the core must be housed within a single crate. The Empire seeks to maximize their total yield, calculated as the crate size $$$x$$$ multiplied by the number of ships successfully deployed.

Given the capacities $$$A$$$, determine the crate size $$$x$$$ that maximizes the total payout.

Input

The first line contains a single integer $$$N$$$ ($$$1 \le N \le 10^6$$$) — the number of transport ships.

The second line contains $$$N$$$ space-separated integers $$$A_1, A_2, \dots, A_N$$$ ($$$1 \le A_i \le 10^6$$$) — the cargo capacities of the ships.

Output

Print a single integer — the crate size $$$x$$$ that maximizes the total payout. If there are multiple values of $$$x$$$ that yield the same maximum profit, print the smallest among them.

Examples
Input
5
2 3 3 4 5
Output
3
Input
5
5 4 3 2 1
Output
1