#P1176D. Recover it!

    ID: 2454 Type: RemoteJudge 4000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>dfs and similargraphsgreedynumber theorysortings*1800

Recover it!

No submission language available for this problem.

Description

Authors guessed an array aa consisting of nn integers; each integer is not less than 22 and not greater than 21052 \cdot 10^5. You don't know the array aa, but you know the array bb which is formed from it with the following sequence of operations:

  1. Firstly, let the array bb be equal to the array aa;
  2. Secondly, for each ii from 11 to nn:
    • if aia_i is a prime number, then one integer paip_{a_i} is appended to array bb, where pp is an infinite sequence of prime numbers (2,3,5,2, 3, 5, \dots);
    • otherwise (if aia_i is not a prime number), the greatest divisor of aia_i which is not equal to aia_i is appended to bb;
  3. Then the obtained array of length 2n2n is shuffled and given to you in the input.

Here paip_{a_i} means the aia_i-th prime number. The first prime p1=2p_1 = 2, the second one is p2=3p_2 = 3, and so on.

Your task is to recover any suitable array aa that forms the given array bb. It is guaranteed that the answer exists (so the array bb is obtained from some suitable array aa). If there are multiple answers, you can print any.

The first line of the input contains one integer nn (1n21051 \le n \le 2 \cdot 10^5) — the number of elements in aa.

The second line of the input contains 2n2n integers b1,b2,,b2nb_1, b_2, \dots, b_{2n} (2bi27501312 \le b_i \le 2750131), where bib_i is the ii-th element of bb. 27501312750131 is the 199999199999-th prime number.

In the only line of the output print nn integers a1,a2,,ana_1, a_2, \dots, a_n (2ai21052 \le a_i \le 2 \cdot 10^5) in any order — the array aa from which the array bb can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.

Input

The first line of the input contains one integer nn (1n21051 \le n \le 2 \cdot 10^5) — the number of elements in aa.

The second line of the input contains 2n2n integers b1,b2,,b2nb_1, b_2, \dots, b_{2n} (2bi27501312 \le b_i \le 2750131), where bib_i is the ii-th element of bb. 27501312750131 is the 199999199999-th prime number.

Output

In the only line of the output print nn integers a1,a2,,ana_1, a_2, \dots, a_n (2ai21052 \le a_i \le 2 \cdot 10^5) in any order — the array aa from which the array bb can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.

Samples

Sample Input 1

3
3 5 2 3 2 4

Sample Output 1

3 4 2

Sample Input 2

1
2750131 199999

Sample Output 2

199999

Sample Input 3

1
3 6

Sample Output 3

6