The GCD table G of size n × n for an array of positive integers a of length n is defined by formula 

<image>

Let us remind you that the greatest common divisor (GCD) of two positive integers x and y is the greatest integer that is divisor of both x and y, it is denoted as <image>. For example, for array a = {4, 3, 6, 2} of length 4 the GCD table will look as follows:

<image>

Given all the numbers of the GCD table G, restore array a.

Input

The first line contains number n (1 ≤ n ≤ 500) — the length of array a. The second line contains n2 space-separated numbers — the elements of the GCD table of G for array a. 

All the numbers in the table are positive integers, not exceeding 109. Note that the elements are given in an arbitrary order. It is guaranteed that the set of the input data corresponds to some array a.

Output

In the single line print n positive integers — the elements of array a. If there are multiple possible solutions, you are allowed to print any of them.

Examples

Input

4
2 1 2 3 4 3 2 6 1 1 2 2 1 2 3 2


Output

4 3 6 2

Input

1
42


Output

42 

Input

2
1 1 1 1


Output

1 1 
import java.util.*;
import java.io.*;

public class GCDTable {

static int gcd(int a, int b) {
    return (b==0)?a:gcd(b,a%b);
}
    public static void main(String[] args) throws IOException{
       Scan in = new Scan();
        Map<Integer, Integer> h = new HashMap<>();
        ArrayList<Integer> x = new ArrayList<>();
        ArrayList<Integer> a = new ArrayList<>();
        StringBuilder re = new StringBuilder();
        int n = in.nextInt();
        for (int i = 0; i < n*n; i++) {
            int y = in.nextInt();
            if (h.get(y)==null) {
                h.put(y, 1);
                x.add(y);
            }else h.put(y, h.get(y)+1);
        }
        int i = x.size()-1;
        Collections.sort(x);
          while(n!=0){
        if (h.get(x.get(i))<=0) {
                --i;
                continue;
            }
              for (int j = 0; j < a.size(); j++) {
                int r= gcd(x.get(i),a.get(j));     
            h.put(r, h.get(r)-2);
              }
            h.put(x.get(i), h.get(x.get(i))-1);
            a.add(x.get(i));
            re.append(x.get(i)+" ");n--;
        }        
        re.deleteCharAt(re.length()-1);
        System.out.println(re);
    }
       static class Scan {

    public java.io.InputStream stream = System.in;
    private final static byte EOF = -1, NL = '\n', D = '-', SPC = ' ', buffer[] = new byte[0xFFFF];
    private char cBuff[] = new char[0xFF];
    public int $index, $readCount, itr;

    private void inc() { cBuff = java.util.Arrays.copyOf(cBuff, cBuff.length << 1); }
    
    private boolean readLINE() throws IOException {
        if ($readCount == EOF) return false;
        for (itr = 0;;) {
            while ($index < $readCount)
                if (buffer[$index] != NL) {
                    if (itr == cBuff.length) inc();
                    cBuff[itr++] = (char)buffer[$index++];
                } else {
                    $index++;
                    return true;
                }
            $index = 0; $readCount = stream.read(buffer);
            if ($readCount == EOF) return true;
        }
    }
    
    private boolean readPRT() throws IOException {
        if ($readCount == EOF) return false;
        T: for (;;) {
            while ($index < $readCount)
                if (buffer[$index] > SPC) break T;
                else $index++;
            $index = 0; $readCount = stream.read(buffer);
            if ($readCount == EOF) return false;
        }
        for (itr = 0;;) {
            while ($index < $readCount)
                if (buffer[$index] > SPC) {
                    if (itr == cBuff.length) inc();
                    cBuff[itr++] = (char)buffer[$index++];
                } else return true;
            $index = 0; $readCount = stream.read(buffer);
            if ($readCount == EOF) return true;
        }
    }

    public int nextInt() throws IOException {
        if (!readPRT())
            throw new IOException();
        else {
            int v = 0, i = 0; boolean neg;
            if (cBuff[i] == D) {neg = true; i++;} else neg = false;
            while (i < itr) v = (v << 3) + (v << 1) + cBuff[i++] - '0';
            return neg ? -v : v;
        }
    }

    public long nextLong() throws IOException {
        if (!readPRT())
            throw new IOException();
        else {
            long v = 0; int i = 0; boolean neg;
            if (cBuff[i] == D) {neg = true; i++;} else neg = false;
            while (i < itr) v = (v << 3L) + (v << 1L) + cBuff[i++] - '0';
            return neg ? -v : v;
        }
    }

    public char[] buffer() throws IOException
    { return readPRT() ? cBuff : null; }

    public String next() throws IOException
    { return readPRT() ? new String(cBuff, 0, itr) : null; }

    public char[] nextArr() throws IOException
    { return readPRT() ? java.util.Arrays.copyOf(cBuff, itr) : null; }

    public String nextLine() throws IOException
    { return readLINE() ? new String(cBuff, 0, itr) : null; }

    public char[] nextLineArr() throws IOException
    { return readLINE() ? java.util.Arrays.copyOf(cBuff, itr) : null; }

    public float nextFloat() throws IOException
    { return Float.parseFloat(next()); }

    public double nextDouble() throws IOException
    { return Double.parseDouble(next()); }
}
}