I. 这真的是签到题
time limit per test
1 second
memory limit per test
512 megabytes
input
standard input
output
standard output

给定一个长度为 $$$n$$$ 的数列 $$$a_1,a_2,a_3,...,a_n$$$,寻找最大的 $$$a_i$$$,满足其所有的质因子都在该数列中

Input

第一行包含一个整数 $$$n$$$

第二行包含 $$$n$$$ 个整数 $$$a_1, a_2, a_3,...,a_n$$$

$$$1\le n\le 10^5,2\le a_i\le10^6$$$

Output

输出一个整数 $$$a_i$$$,$$$a_{i}$$$ 为最大的且所有质因子在该数列中的数,如果不存在则输出 $$$-1$$$

Examples
Input
10
7 9 9 11 4 11 3 3 8 7
Output
11
Input
2
6 6
Output
-1