import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.StringTokenizer;

public class GCD_Table {
    @SuppressWarnings({ "rawtypes"})
    public static void main(String[] args) throws Exception {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        int n = Integer.parseInt(in.readLine().trim());
        HashMap<Integer, Integer> map = new HashMap<Integer,Integer>();
        StringTokenizer st = new StringTokenizer(in.readLine());
        for(int i = 0 ; i < n*n ; i++){
            int ele = Integer.parseInt(st.nextToken());
            if(map.containsKey(ele)){
                map.put(ele, map.get(ele)+1);
            }else{
                map.put(ele, 1);
            }
        }
        int rev = 0;
        while(rev != n*n-n){
            Iterator it = map.entrySet().iterator();
            while(it.hasNext()&&(rev !=n*n-n)){
                @SuppressWarnings("unchecked")
                Map.Entry<Integer,Integer> pair = (Map.Entry<Integer,Integer>) it.next();
                if(pair.getValue()>= 2){
                    map.put(pair.getKey(), pair.getValue()-2);
                    rev+=2;
                }
                if(map.get(pair.getKey())==1){
                    out.print(pair.getKey()+" ");
                    it.remove();
                }
                else if(map.get(pair.getKey())==0){
                    it.remove();
                }
            }
        }
        Iterator it = map.entrySet().iterator();
        while(it.hasNext()){
            @SuppressWarnings("unchecked")
            Map.Entry<Integer,Integer> pair = (Map.Entry<Integer,Integer>) it.next();
            for(int i = 0;i<pair.getValue();i++)
                out.print(pair.getKey()+" ");
        }
        in.close();
        out.close();
    }
}
