Yo`nalishlar
Hozirda online

Statistika

Masalalar soni: 909

Foydalanuvchilar soni: 8821

Jo'natishlar soni: 714440

Muhokama yozuvlari: 4541

Yangiliklar soni: 97

Yangiliklar izohlari: 1174


So'ngi izohlar

753. Greatest Greatest Common Divisor
Vaqt limiti: 2 sekund
Xotira limiti: 64 MB

Andrew has just made a breakthrough in sociology: he realized how to predict whether two persons will be good friends or not. It turns out that each person has an inner friendship number (a positive integer). And the quality of friendship between two persons is equal to the greatest common divisor of their friendship number. That means there are prime people (with a prime friendship number) who just can't find a good friend, andОписание: 63975f390397d0e50d9e6152d7f57799Wait, this is irrelevant to this problem. You are given a list of friendship numbers for several people. Find the highest possible quality of friendship among all pairs of given people. 

Input

The first line of the input file contains an integer n (2≤n≤106) — the number of people to process. The next n lines contain one integer each, between 1 and 106 (inclusive), the friendship numbers of the given people. All given friendship numbers are distinct. 

Output

Output one integer — the highest possible quality of friendship. In other words, output the greatest greatest common divisor among all pairs of given friendship numbers. 

Samples

Input

Output

1

4

9

15

25

16

5

 

Tayyorladi: Azat Yusupov
Text from: acm.sgu.ru
Mening urinishlarim(0) Muhokama (0) Jo'natish Eng yaxshi yechimlar Barcha muvaffaqiyatli urinishlar(14) Barcha urinishlar(94)