import sun.misc.resources.Messages_pt_BR;

import javax.print.attribute.standard.MediaPrintableArea;
import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.util.*;

/**
 * Created by Firеfly on 1/1/2017.
 */
public class Task {
    public static void main(String[] args) throws IOException {
        Emaxx emaxx = new Emaxx();
    }
}


class Emaxx {
    FScanner fs;
    PrintWriter pw;

    Emaxx() throws IOException {
        fs = new FScanner(new InputStreamReader(System.in));
        // pw = new PrintWriter(new FileWriter("arithnumbers.out"));
        //  fs = new FScanner(new FileReader("C:\\Users\\Firеfly\\Desktop\\New Text Document.txt"));
        //     fs = new FScanner(new FileReader("input.txt"));;
        //       pw = new PrintWriter("output.txt");
        PrintWriter pw = new PrintWriter(System.out);
        int n = fs.nextInt();
        int[] mas = new int[n*n];
        for (int i =0 ; i<n*n; i++)
            mas[i] = fs.nextInt();
        TreeMap<Integer, Integer> map = new TreeMap<>();
        for (int i = 0; i<n*n; i++) {
            if (map.containsKey(mas[i]))
                map.put(mas[i], map.get(mas[i])+1);
            else map.put(mas[i], 1);
        }
        int[] answer = new int[n];
        answer[0] = map.lastKey();
        if (map.get(map.lastKey()) == 1)
            map.remove(map.lastKey());
        else {
            map.put(map.lastKey(), map.get(map.lastKey())-1);
        }
        int current = 1;
        while (current<n) {
            answer[current] = map.lastKey();
            if (map.get(map.lastKey()) == 1)
                map.remove(map.lastKey());
            else {
                map.put(map.lastKey(), map.get(map.lastKey())-1);
            }
            for (int i = 0; i<current; i++) {
                int curnum = gcd(Math.max(answer[i], answer[current]), Math.min(answer[i], answer[current]));
                if (map.get(curnum) == 2)
                    map.remove(curnum);
                else {
                    map.put(curnum, map.get(curnum)-2);
                }
            }
            current++;
        }
        for (int i = 0; i<n; i++)
            System.out.print(answer[i] + " ");
        pw.close();
    }
    int gcd(int a, int b) {
        if (b == 0)
            return a;
        else return gcd(b, a%b);
    }
}
class FScanner {
    BufferedReader br;
    StringTokenizer st;
    FScanner(InputStreamReader isr) {
        br = new BufferedReader(isr);
    }

    FScanner(FileReader fr) {
        br = new BufferedReader(fr);
    }

    String nextToken() throws IOException{
        while (st == null || !st.hasMoreTokens()) {
            String s = br.readLine();
            if (s == null)
                return null;
            st = new StringTokenizer(s);
        }
        return st.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

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

    String nextLine() throws IOException {
        return br.readLine();
    }

    char nextChar() throws IOException {
        return (char) br.read();
    }

}

