import java.io.FileNotFoundException;
import java.util.*;

public class Main {

    private static int gcd( int a, int b ) {
        while ( b != 0 ) {
            a %= b;
            int k = a;
            a = b;
            b = k;
        }
        return a;
    }

    public static void main( String[] args ) throws FileNotFoundException {
        Scanner scan = new Scanner( System.in );
        int n = scan.nextInt();
        int nn = n * n;
        SortedMap<Integer, Integer> map = new TreeMap<>();
        for ( int i = 0; i < nn; ++i ) {
            int x = -scan.nextInt();
            Integer value = map.get( x );
            if ( value == null ) {
                map.put( x, 1 );
            } else {
                map.put( x, value + 1 );
            }
        }

        List<Integer> result = new ArrayList<>();
        for ( Map.Entry<Integer, Integer> entry : map.entrySet() ) {
            int key = -entry.getKey();
            while ( entry.getValue() > 0 ) {
                result.add( key );
                for ( Integer res : result ) {
                    int g = -gcd( key, res );
                    int value = map.get( g );
                    map.put( g, value - 1 );
                }
            }

        }

        for ( int i = 0; i < n; ++i ) {
            System.out.print( result.get( i ) + " " );
        }
    }
}
