Recover it!

题意翻译

从前有一个长度为$n$的数组$a$,其中每一个数都在$2$到$2\cdot10^5$之间,你不知道$a$,但是你知道另一个长度为$2n$的数组$b$,$b$是由$a$生成的。 生成方式如下: 首先,让$b$等于$a$。 然后,对于$a$中的每一个数$a_i$,如果这是一个质数,那么就把第$a_i$小的质数添加到$b$的末尾,否则,就把$a_i$的最大的不等于$a_i$的因子添加到$b$的末尾。 最后把$b$打乱顺序。 你需要找到任意一组合法的$a$,使得$a$可以生成$b$。

题目描述

Authors guessed an array $ a $ consisting of $ n $ integers; each integer is not less than $ 2 $ and not greater than $ 2 \cdot 10^5 $ . You don't know the array $ a $ , but you know the array $ b $ which is formed from it with the following sequence of operations: 1. Firstly, let the array $ b $ be equal to the array $ a $ ; 2. Secondly, for each $ i $ from $ 1 $ to $ n $ : - if $ a_i $ is a prime number, then one integer $ p_{a_i} $ is appended to array $ b $ , where $ p $ is an infinite sequence of prime numbers ( $ 2, 3, 5, \dots $ ); - otherwise (if $ a_i $ is not a prime number), the greatest divisor of $ a_i $ which is not equal to $ a_i $ is appended to $ b $ ; 3. Then the obtained array of length $ 2n $ is shuffled and given to you in the input. Here $ p_{a_i} $ means the $ a_i $ -th prime number. The first prime $ p_1 = 2 $ , the second one is $ p_2 = 3 $ , and so on. Your task is to recover any suitable array $ a $ that forms the given array $ b $ . It is guaranteed that the answer exists (so the array $ b $ is obtained from some suitable array $ a $ ). If there are multiple answers, you can print any.

输入输出格式

输入格式


The first line of the input contains one integer $ n $ ( $ 1 \le n \le 2 \cdot 10^5 $ ) — the number of elements in $ a $ . The second line of the input contains $ 2n $ integers $ b_1, b_2, \dots, b_{2n} $ ( $ 2 \le b_i \le 2750131 $ ), where $ b_i $ is the $ i $ -th element of $ b $ . $ 2750131 $ is the $ 199999 $ -th prime number.

输出格式


In the only line of the output print $ n $ integers $ a_1, a_2, \dots, a_n $ ( $ 2 \le a_i \le 2 \cdot 10^5 $ ) in any order — the array $ a $ from which the array $ b $ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.

输入输出样例

输入样例 #1

3
3 5 2 3 2 4

输出样例 #1

3 4 2 

输入样例 #2

1
2750131 199999

输出样例 #2

199999 

输入样例 #3

1
3 6

输出样例 #3

6