#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const long long INF = 1e18;
const long double PI = 4 * atan((long double)1);
const int INFTY = 1e7;
int main() {
  long long n;
  cin >> n;
  map<int, int> freq;
  long long x;
  long long nsq = n * n;
  for (int i = 0; i < (nsq); i++) cin >> x, freq[x]++;
  vector<pair<long long, long long>> a;
  for (const auto& pp : freq) {
    a.push_back({pp.second, pp.first});
  }
  sort(a.begin(), a.end());
  long long left = n * n;
  int ptr = 0;
  while (left != n) {
    if (a[ptr].first >= 2) {
      a[ptr].first -= 2;
      left -= 2;
    } else {
      ptr++;
    }
  }
  int sz = a.size();
  for (int i = 0; i < sz; ++i) {
    for (int j = 0; j < a[i].first; j++) {
      cout << a[i].second << " ";
    }
  }
  cout << endl;
}
