#include <bits/stdc++.h>
using namespace std;
long long int me(long long int x, long long int n) {
  if (n == 0)
    return 1;
  else if (n % 2 == 0)
    return me((x * x) % 1000000007, n / 2);
  else
    return (x * me((x * x) % 1000000007, (n - 1) / 2)) % 1000000007;
}
bool IsPrime(long long int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
void solve() {
  long long int n;
  cin >> n;
  map<long long int, long long int> m;
  for (long long int i = 0; i < n * n; i++) {
    long long int k;
    cin >> k;
    m[k]++;
  }
  long long int cnt = 0;
  vector<long long int> ans;
  for (auto it : m) {
    if (it.second % 2 != 0) {
      cnt++;
      ans.push_back(it.first);
      m[it.first]--;
    }
    if (cnt == n) {
      for (auto i : ans) cout << i << " ";
      return;
    }
  }
  for (auto it : m) {
    if (it.second >= 2) {
      ans.push_back(it.first);
      ans.push_back(it.first);
      cnt += 2;
    }
    if (cnt == n) {
      for (auto i : ans) cout << i << " ";
      return;
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  long long int t = 1;
  while (t--) solve();
  return 0;
}
