import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Map;
import java.io.BufferedReader;
import java.util.TreeMap;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Random;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.util.Arrays;
import java.util.concurrent.ThreadLocalRandom;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Vadim Semenov
 */
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 solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(final int testNumber, final InputReader in, final PrintWriter out) {
            int n = in.nextInt();
            int[] a = new int[n];
            int[] gcd = new int[n * n];
            Map<Integer, Integer> map = new TreeMap<>();
            for (int i = 0; i < gcd.length; ++i) {
                gcd[i] = in.nextInt();
                Integer cnt = map.get(gcd[i]);
                if (cnt == null) {
                    cnt = 0;
                }
                ++cnt;
                map.put(gcd[i], cnt);
            }
            ArrayUtils.sort(gcd);
            int ptr = n - 1;
            for (int i = gcd.length - 1; i >= 0; --i) {
                if (map.get(gcd[i]) == 0) continue;
                a[ptr] = gcd[i];
                map.put(a[ptr], map.get(a[ptr]) - 1);
                for (int j = ptr + 1; j < a.length; ++j) {
                    int foo = gcd(a[ptr], a[j]);
                    map.put(foo, map.get(foo) - 2);
                }
                --ptr;
            }
            if (ptr != -1) throw new AssertionError(ptr);
            for (int i : a) {
                out.print(i + " ");
            }
        }

        private int gcd(int a, int b) {
            while (b != 0) {
                int c = a % b;
                a = b;
                b = c;
            }
            return a;
        }

    }

    static class InputReader {
        private final BufferedReader reader;
        private StringTokenizer tokenizer;

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

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

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(readLine());
            }
            return tokenizer.nextToken();
        }

        public String readLine() {
            String line;
            try {
                line = reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return line;
        }

    }

    static class ArrayUtils {
        private static final Random RANDOM = ThreadLocalRandom.current();

        private ArrayUtils() {
        }

        public static void shuffle(int[] array) {
            for (int i = 1; i < array.length; ++i) {
                int j = RANDOM.nextInt(i + 1);
                int tmp = array[i];
                array[i] = array[j];
                array[j] = tmp;
            }
        }

        public static void sort(int[] array) {
            shuffle(array);
            Arrays.sort(array);
        }

    }
}

