/*
If you want to aim high, aim high
Don't let that studying and grades consume you
Just live life young
******************************
What do you think? What do you think?
1st on Billboard, what do you think of it
Next is a Grammy, what do you think of it
However you think, I’m sorry, but shit, I have no fcking interest
*******************************
I'm standing on top of my Monopoly board
That means I'm on top of my game and it don't stop
til my hip don't hop anymore
https://www.a2oj.com/Ladder16.html
*******************************
300iq as writer = Sad!
*/
import java.util.*;
import java.io.*;
import java.math.*;

   public class A
   {
      public static void main(String hi[]) throws Exception
      {
         BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));
         StringTokenizer st = new StringTokenizer(infile.readLine());
         int N = Integer.parseInt(st.nextToken());
         int[] arr = new int[N*N];
         st = new StringTokenizer(infile.readLine());
         for(int i=0; i < N*N; i++)
            arr[i] = Integer.parseInt(st.nextToken());
         TreeMap<Integer, Integer> mset = new TreeMap<Integer, Integer>();
         for(int x: arr)
            push(mset, x);
         ArrayList<Integer> ls = new ArrayList<Integer>();
         while(mset.size() > 0)
         {
            int max = mset.lastKey();
            pull(mset, max);
            for(int x: ls)
            {
               int gcd = (int)gcd(x, max);
               pull(mset, gcd);  pull(mset, gcd);
            }
            ls.add(max);
         }
         StringBuilder sb = new StringBuilder();
         for(int x: ls)
            sb.append(x+" ");
         System.out.print(sb);
      }
      public static void push(TreeMap<Integer, Integer> map, int k)
      {
         if(!map.containsKey(k))
            map.put(k, 0);
         map.put(k, map.get(k)+1);
      }
      public static void pull(TreeMap<Integer, Integer> map, int k)
      {
         map.put(k, map.get(k)-1);
         if(map.get(k) == 0)
            map.remove(k);
      }
      public static long gcd(long a, long b)
      {
         if(a > b)
         {
            long t = a;
            a = b;
            b = t;
         }
         if(a == 0L)
            return b;
         return gcd(b%a, a);
      }
   }