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

public class A implements Runnable {

    private static final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;

    private BufferedReader in;
    private PrintWriter out;
    private StringTokenizer tok = new StringTokenizer("");

    private void init() throws FileNotFoundException {
        Locale.setDefault(Locale.US);
        String fileName = "";
        if (ONLINE_JUDGE && fileName.isEmpty()) {
            in = new BufferedReader(new InputStreamReader(System.in), 32768);
            out = new PrintWriter(System.out);
        } else {
            if (fileName.isEmpty()) {
                in = new BufferedReader(new FileReader("input.txt"));
                out = new PrintWriter("output.txt");
            } else {
                in = new BufferedReader(new FileReader(fileName + ".in"));
                out = new PrintWriter(fileName + ".out");
            }
        }
    }

    String readString() {
        while (!tok.hasMoreTokens()) {
            try {
                tok = new StringTokenizer(in.readLine());
            } catch (Exception e) {
                return null;
            }
        }
        return tok.nextToken();
    }

    int readInt() {
        return Integer.parseInt(readString());
    }

    long readLong() {
        return Long.parseLong(readString());
    }

    double readDouble() {
        return Double.parseDouble(readString());
    }

    int[] readIntArray(int size) {
        int[] a = new int[size];
        for (int i = 0; i < size; i++) {
            a[i] = readInt();
        }
        return a;
    }

    public static void main(String[] args) {
        //new Thread(null, new _Solution(), "", 128 * (1L << 20)).start();
        new A().run();
    }

    long timeBegin, timeEnd;

    void time() {
        timeEnd = System.currentTimeMillis();
        System.err.println("Time = " + (timeEnd - timeBegin));
    }

    @Override
    public void run() {
        try {
            timeBegin = System.currentTimeMillis();
            init();
            solve();
            out.close();
            time();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }
    }

    void poll(TreeMap<Integer, Integer> map, int x) {
        int count = map.get(x);
        if (count > 1) {
            map.put(x, count - 1);
        } else {
            map.remove(x);
        }
    }

    private void solve() throws IOException {
        int n = readInt();
        TreeMap<Integer, Integer> set = new TreeMap<>();
        for (int i = 0; i < n * n; i++) {
            int x = readInt();
            Integer count = set.get(x);
            if (count == null) {
                count = 0;
            }
            set.put(x, count + 1);
        }

        List<Integer> ans = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            int cur = set.lastKey();
            poll(set, cur);
            for (int x : ans) {
                poll(set, gcd(x, cur));
                poll(set, gcd(x, cur));
            }
            ans.add(cur);
        }

        for (int x : ans) {
            out.print(x + " ");
        }
    }

    int gcd(int a, int b) {
        return a == 0 ? b : gcd(b % a, a);
    }
}
