Authors guessed an array a consisting of n integers; each integer is not less than 2 and not greater than 2 ⋅ 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, ...); 
    * 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.

Input

The first line of the input contains one integer n (1 ≤ n ≤ 2 ⋅ 10^5) — the number of elements in a.

The second line of the input contains 2n integers b_1, b_2, ..., b_{2n} (2 ≤ b_i ≤ 2750131), where b_i is the i-th element of b. 2750131 is the 199999-th prime number.

Output

In the only line of the output print n integers a_1, a_2, ..., a_n (2 ≤ a_i ≤ 2 ⋅ 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.

Examples

Input


3
3 5 2 3 2 4


Output


3 4 2 

Input


1
2750131 199999


Output


199999 

Input


1
3 6


Output


6 

import java.util.*;
import java.lang.*;
import java.lang.reflect.Array;
import java.io.*;
import java.math.*;
import java.text.DecimalFormat;
public class Temp{     
    static class InputReader { 
        private final InputStream stream;
	private final byte[] buf = new byte[8192];
	private int curChar, snumChars;
 	public InputReader(InputStream st) {
            this.stream = st;
	} 
	public int read() {
            if (snumChars == -1)
	 	throw new InputMismatchException();
            if (curChar >= snumChars) {
		curChar = 0;
                try {
                    snumChars = stream.read(buf);
		} 
                catch (IOException e) {
                    throw new InputMismatchException();
           	}
		if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
	}
        public int ni() {
            int c = read();
            while (isSpaceChar(c)) {
               	c = read();
            }
            int sgn = 1;
            if (c == '-') {
		sgn = -1;
		c = read();
            }
            int res = 0;
            do {
		res *= 10;
		res += c - '0';
		c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
	} 
	public long nl() {
            int c = read();
            while (isSpaceChar(c)) {
            c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
	} 
	public int[] nia(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
		a[i] = ni();
            }
            return a;
	} 
	public String rs() {
            int c = read();
            while (isSpaceChar(c)) {
		c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
		res.appendCodePoint(c);
                    c = read();
            } while (!isSpaceChar(c));
            return res.toString();
	}
	public String nextLine() {
            int c = read();
            while (isSpaceChar(c))
		c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        } 
	public boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}
 
	private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
	} 
    }
    static PrintWriter w = new PrintWriter(System.out);
    public static class Key {

        private final int x;
        private final int y;

        public Key(int x, int y) {
            this.x = x;
            this.y = y;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (!(o instanceof Key)) return false;
            Key key = (Key) o;
            return x == key.x && y == key.y;
        }

        @Override
        public int hashCode() {
            int result = x;
            result = 31 * result + y;
            return result;
        }
    }
    static long mod=1000000007L;
    static ArrayList<Integer> arr[];
    static int n;
    static boolean prime[]=new boolean[(int)(1e7+1)];
    static ArrayList<Integer> pri=new ArrayList<>();
    static int maxD[]=new int[(int)3e6+1];
    static void findMaxD(){
        for(int i:pri){
            if(i<=2)continue;
            if(prime[i]){
                for(int j=3;(j*i)<=(int)3e6;j+=2){
                    maxD[j*i]=Math.max(Math.max(i, j),maxD[j*i]);
                }
            }    
        }
        for(int i=2;i<=(int)3e6;i+=2){
            maxD[i]=i/2;
        }
    }

    static void sieve() {
	Arrays.fill(prime, true);
        pri.add(-1);
	prime[0] = prime[1] = false;
	for(int i = 2 ; i <=(int)1e7 ; ++i) {
            if(prime[i]) {
                pri.add(i);
                int j=2*i;
                while(j<=(int)1e7){
                    prime[j]=false;
                    j+=i;
                }
            }
	}
			
    }
    public static void main (String[] args)throws IOException{
        InputReader sc=new InputReader(System.in);
        sieve();
        findMaxD();
        
        int n=sc.ni();
        //TreeMap<Integer,Integer> map=new TreeMap<>();
        int co[]=new int[(int)3e6+1];
        for(int i=0;i<2*n;i++){
            int a=sc.ni();
            co[a]++;
//            if(map.containsKey(a))map.replace(a,map.get(a)+1);
//            else map.put(a,1);
        }
        ArrayList<Integer> ans=new ArrayList<>();
        for(int i=(int)3e6;i>2;i--){
            if(co[i]>0&&!prime[i]){
                int l=co[i];
                for(int k=0;k<l&&co[maxD[i]]>0;k++){
                    ans.add(i);
                    co[i]--;
                    co[maxD[i]]--;
                }
            }
        }
        for(int i=2;i<=(int)3e6;i++){
            if(co[i]>0&&prime[i]){
                int l=co[i];
                for(int k=0;k<l&&co[pri.get(i)]>0;k++){
                    co[i]--;
                    co[pri.get(i)]--;
                    ans.add(i);
                }
            }
        }
        
        
       
        for(int i:ans)w.print(i+" ");
        w.println();
    	w.close();
    }
}