import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

public class P323_1A implements Runnable {
  int nextInt(StreamTokenizer in) throws Exception {
    in.nextToken();
    return (int) in.nval;
  }

  StreamTokenizer in;

  private int nextInt() throws Exception {
    in.nextToken();
    return (int) in.nval;
  }

  int gcd(int a, int b) {
    if (a < b) {
      return gcd(b, a);
    }
    if (b == 0) {
      return a;
    }
    return gcd(b, a % b);
  }

  @Override
  public void run() {
    try {
      in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
      int n = nextInt();
      int n2 = n * n;
      int[] g = new int[n2];
      for (int i = 0; i < n2; i++) {
        g[i] = nextInt();
      }
      Arrays.sort(g);
      int[] r = new int[n];
      int c = n2 - 1;
      Map<Integer, Integer> count = new HashMap<>();
      for (int i = 0; i < n; i++) {
        while (count.containsKey(g[c])) {
          int num = count.get(g[c]);
          if (num > 1) {
            count.put(g[c], num - 1);
          } else {
            count.remove(g[c]);
          }
          c--;
        }
        r[i] = g[c];
        c--;
        for (int j = 0; j < i; j++) {
          int gcd = gcd(r[i], r[j]);
          if (count.containsKey(gcd)) {
            count.put(gcd, count.get(gcd) + 2);
          } else {
            count.put(gcd, 2);
          }
        }
      }
      for (int i = 0; i < n; i++) {
        System.out.print(r[i] + " ");
      }
      System.out.println();
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }

  public static void main(String[] args) {
    new Thread(new P323_1A()).start();
  }
}
