import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class GCD_Table {
    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());
        int input [] = new int [n*n];
        StringTokenizer st = new StringTokenizer(in.readLine());
        for(int i = 0 ; i < input.length ; i++){
            input[i] = Integer.parseInt(st.nextToken());
        }
        Arrays.sort(input);
        int sat = 0;
        for(int i = 0;i<input.length;){
            if((i == (n*n -1))||input[i]!=input[i+1] || (sat == n*n-n)){
                out.print(input[i]+" ");
                i++;
            }else{
                i+=2;
                sat+=2;
            }
        }
        in.close();
        out.close();
    }
}
