#include <bits/stdc++.h>
using namespace std;
map<int, int> m;
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n * n; i++) {
    int x;
    cin >> x;
    m[x]++;
  }
  vector<int> v;
  for (auto it = m.begin(); it != m.end(); it++) {
    if ((it->second) & 1) v.push_back(it->first);
  }
  int left = n - v.size();
  for (auto it = m.rbegin(); it != m.rend(); it++) {
    if (left == 0) break;
    v.push_back(it->first);
    left--;
  }
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
  if (left != 0) {
    while (left--) cout << v[v.size() - 1] << " ";
  }
  return 0;
}
