#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define ff first
#define VI vector <int>
#define ss second
#define pii pair<int, int>
#define pci pair<char, int>
#define mii map<int, int>
#define mci map<char, int>
#define setbits(n) __builtin_popcount(n)
#define fill(a,b) memset(a, b, sizeof(a))
#define all(v) (v).begin(), (v).end()
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define endl "\n"
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define PI 3.14159265
const long long N=5e6+5;
const long long mod=1000000007;

int lcm(int a, int b){
    int g=__gcd(a, b);
    return a/g*b;
}

int32_t main(){
    IOS;
	int t;             // DONT USE ll FROM NOW
	t=1;
// 	cin>>t;
	while (t--){
	    int n;
	    cin>>n;
	    mii m;
	    for (int i=0; i<n*n; i++){
	        int x;
	        cin>>x;
	        m[x]++;
	    }
	    int c=0;
	    for (auto it=m.begin(); it!=m.end(); it++){
	        if (it->ss%2){
	            cout<<it->ff<<" ";
	            c++;
	        }
	    }
	    c=n-c;
	    while (c){
	    for (auto it=m.begin(); it!=m.end(); it++){
	        if (it->ss%2==0){
	            if (c==0) break;
	            cout<<it->ff<<" ";
	            c--;
	        }
	    }
	    }
	}
	return 0;
}
