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.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.io.InputStream;
import java.io.BufferedReader;
import java.util.List;
import java.util.TreeMap;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.util.Collection;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author AlexFetisov
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA_CF323 solver = new TaskA_CF323();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA_CF323 {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            TreeCounter<Integer> counter = new TreeCounter<Integer>();
            List<Integer> res = new ArrayList<Integer>(n);
            for (int i = 0; i < n * n; ++i) {
                counter.add(in.nextInt());
            }
            for (int iter = 0; iter < n; ++iter) {
                int value = counter.last();
                counter.remove(value);
                for (int x : res) {
                    counter.remove(IntegerUtils.gcd(x, value));
                    counter.remove(IntegerUtils.gcd(x, value));
                }
                res.add(value);
            }
            out.println(ArrayUtils.toString(res));
        }

    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer stt;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                return null;
            }
        }

        public String nextString() {
            while (stt == null || !stt.hasMoreTokens()) {
                stt = new StringTokenizer(nextLine());
            }
            return stt.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextString());
        }

    }

    static class ArrayUtils {
        public static String toString(Collection<Integer> collection) {
            StringBuilder result = new StringBuilder("");
            for (int x : collection) {
                result.append(x).append(" ");
            }
            return result.substring(0, result.length() - 1);
        }

    }

    static class IntegerUtils {
        public static int gcd(int x, int y) {
            return y == 0 ? x : gcd(y, x % y);
        }

    }

    static class TreeCounter<K> {
        private final TreeMap<K, Integer> map;
        long size;

        public TreeCounter() {
            map = new TreeMap<K, Integer>();
            size = 0;
        }

        public int add(K key, int count) {
            Integer value = map.get(key);
            if (value == null) {
                value = 0;
            }
            value += count;
            map.put(key, value);
            size += count;
            return value;
        }

        public int add(K key) {
            return add(key, 1);
        }

        public int remove(K key) {
            Integer value = map.get(key);
            if (value == null) {
                return 0;
            }
            --value;
            if (value == 0) {
                map.remove(key);
            } else {
                map.put(key, value);
            }
            --size;
            return value;
        }

        public K last() {
            return map.lastKey();
        }

    }
}
