import java.util.LinkedList;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Queue;
import java.io.IOException;
import java.util.Arrays;
import java.util.TreeMap;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Random;
import java.util.HashMap;
import java.io.BufferedReader;
import java.util.Map;
import java.util.Collection;
import java.util.Set;
import java.util.StringTokenizer;

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

class TaskA {
    Scanner in;
    PrintWriter out;

    public void solve(int testNumber, Scanner in, PrintWriter out) {
        this.in = in;
        this.out = out;
        run();
    }

    void run() {
        int n = in.nextInt();
        int[] is = in.nextIntArray(n * n);
        TreeMap<Integer, Integer> cnt = new TreeMap<>();
        for (int i : is) Num.inc(cnt, i);
        int[] res = new int[n];
        Queue<Integer> que = new LinkedList<>();
        for (Map.Entry<Integer, Integer> e : cnt.entrySet()) {
            if (e.getValue() % 2 == 1) {
                que.add(e.getKey());
            }
        }
        int r = 0;
        while (r < n) {
if (que.isEmpty()) {
                que.add(cnt.lastKey());
            }
            int crt = res[r++] = que.poll();
            for (int i = 0; i < r; i++) {
                dec(cnt, Num.gcd(res[i], crt), i < r - 1 ? 2 : 1);
            }
            if (cnt.containsKey(crt) && cnt.get(crt) % 2 == 1) {
                que.add(crt);
            }
        }
        for (int i : res) out.print(i + " ");
        out.println();
    }

    private void dec(TreeMap<Integer, Integer> cnt, int k, int v) {
if (cnt.get(k) == v) {
            cnt.remove(k);
        } else {
            cnt.put(k, cnt.get(k) - v);
        }
    }
}

class Scanner {
    BufferedReader br;
    StringTokenizer st;

    public Scanner(InputStream in) {
        br = new BufferedReader(new InputStreamReader(in));
        eat("");
    }

    private void eat(String s) {
        st = new StringTokenizer(s);
    }

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

    public boolean hasNext() {
        while (!st.hasMoreTokens()) {
            String s = nextLine();
            if (s == null)
                return false;
            eat(s);
        }
        return true;
    }

    public String next() {
        hasNext();
        return st.nextToken();
    }

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

    public int[] nextIntArray(int n) {
        int[] is = new int[n];
        for (int i = 0; i < n; i++) {
            is[i] = nextInt();
        }
        return is;
    }

}

class Num {

    public static int gcd(int a, int b) {
        while (b != 0) {
            int c = a;
            a = b;
            b = c % b;
        }
        if (a < 0) a = -a;
        return a;
    }

    public static <K> void inc(Map<K, Integer> map, K k) {
        if (!map.containsKey(k)) map.put(k, 1);
        else map.put(k, map.get(k) + 1);
    }

}

