
//package solution;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.PriorityQueue;
import java.util.StringTokenizer;

public class Solution implements Runnable {
    
    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");
    final boolean OJ = System.getProperty("ONLINE_JUDGE") != null;
    
    void init() throws FileNotFoundException {
        if (OJ) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        } else {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        }
            
    }
    
    public void run() {
        try {
            init();
            solve();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }
    }
    
    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        
        return tok.nextToken();
    }
    
    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }
    
    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    public static void main(String[] args) {
        new Thread(null, new Solution(), "", 256 * 1l << 20).start();
    }
    
    
    PriorityQueue<Integer> allNums;
    PriorityQueue<Integer> toDelete;
    int n;
    ArrayList<Integer> known;
    
    int gcd(int a, int b) {
        if (b == 0) return a;
        else return gcd(b, a % b);
    }
    
    void solve() throws IOException {
        n = readInt();
        allNums = new PriorityQueue<>();
        toDelete = new PriorityQueue<>();
        known = new ArrayList<>();
        for (int i = 0; i < n * n; i++) {
            allNums.add(-readInt());
        }
        for (int i = 0; i < n; i++) {
            while (toDelete.size() != 0 && toDelete.peek().equals(allNums.peek())) {
                toDelete.remove();
                allNums.remove();
            }
            int curr = -allNums.poll();
            for (int currKnown : known) {
                toDelete.add(-gcd(curr, currKnown));
                toDelete.add(-gcd(curr, currKnown));
            }
            known.add(curr);
        }
        for (int x : known) {
            out.print(x + " ");
        }
    }
}
