#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  long long y = n;
  n = n * n;
  long long a[n];
  map<long long, long long> mp;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    mp[a[i]]++;
  }
  vector<long long> v;
  for (auto p : mp) {
    if (p.second == 1) {
      v.push_back(p.first);
      mp[p.first]--;
    }
  }
  for (auto p : mp) {
    if (p.second % 2 != 0) {
      v.push_back(p.first);
      mp[p.first]--;
    }
  }
  if (v.size() == y) {
    for (auto p : v) cout << p << " ";
    cout << "\n";
  } else if (v.size() < y) {
    for (auto p : mp) {
      if ((p.second) % 2 == 0 && p.second >= 2) {
        v.push_back(p.first);
        if (v.size() == y) break;
        v.push_back(p.first);
        mp[p.first] -= 2;
        if (v.size() == y) break;
      }
    }
    for (auto p : v) cout << p << " ";
    cout << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  while (t--) solve();
  return 0;
}
