import java.util.*;

public class A {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int n = in.nextInt();
    ArrayList<Integer> l = new ArrayList<>();
    Map<Integer, Integer> gcdCount = new HashMap<>();
    for (int i = 0 ; i<n*n; ++i) {
      int g = in.nextInt();
      l.add(g);
      if (gcdCount.containsKey(g)) {
        gcdCount.put(g,gcdCount.get(g)+1);
      } else {
        gcdCount.put(g,1);
      }
    }
    Collections.sort(l);
    /*int[] countArray = new int[l.get(l.size()-1)+1];
    for(int i=0;i<countArray.length;++i) {
      if (gcdCount.containsKey(i)) {
        countArray[i] = gcdCount.get(i);
      } else {
        countArray[i] = -1;
      }
    }*/
    // System.err.println(Arrays.toString(countArray));
    int pointer = l.size()-1;
    // System.err.println(pointer);
    List<Integer> answers = new ArrayList<>();
    while (pointer != -1 && answers.size() < n) {
      int ans1 = l.get(pointer);
      updateCountArray(gcdCount, answers, ans1);
      pointer = updatePointer(gcdCount, l, pointer);
      // System.err.println(gcdCount);
      // System.err.println(pointer);
      answers.add(ans1);
    }
    for(int a : answers) {
      System.out.print(a + " ");
    }
  }
  
  public static void updateCountArray(Map<Integer, Integer> gcdCount, List<Integer> answers, int ans1) {
    gcdCount.put(ans1,gcdCount.get(ans1)-2);
    // countArray[ans1]--;
    for(int a : answers) {
      gcdCount.put(gcd(a,ans1),gcdCount.get(gcd(a,ans1))-2);
      // countArray[gcd(a,ans1)]-=2;
    }
  }
  
  public static int gcd(int a, int b) {
    if (b > a) return gcd(b,a);
    if (b == 0) return a;
    return gcd(b,a%b);
  }
  
  public static int updatePointer(Map<Integer, Integer> gcdCount, List<Integer> l, int pointer) {
    /*System.err.println("updating");
    System.err.println(Arrays.toString(countArray));
    System.err.println(pointer);*/
    for(int i = pointer; i >= 0; i--) {
      if (gcdCount.get(l.get(i)) > 0) {
        return i;
      }
    }
    return -1; // problem is solved
  }
}