#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int a[n * n];
  map<int, int> m;
  for (int i = 0; i < n * n; i++) {
    int x;
    cin >> x;
    m[x]++;
  }
  vector<int> v;
  for (auto i : m) {
    if (i.second % 2 == 1) {
      v.push_back(i.first);
      m[i.first]--;
    }
  }
  vector<int> z;
  for (auto i : m) {
    if (i.second != 0)
      for (int j = 0; j < i.second; j++) z.push_back(i.first);
  }
  sort(z.begin(), z.end());
  int lpop = 0;
  int cnt = 0;
  while (v.size() != n) {
    v.push_back(z[z.size() - 1]);
    v.push_back(z[z.size() - 1]);
    z.pop_back();
    z.pop_back();
    z.pop_back();
    z.pop_back();
    if (v[v.size() - 1] == lpop) {
      int x = 2 * cnt;
      while (x--) {
        z.pop_back();
      }
      cnt += 2;
    } else {
      lpop = v[v.size() - 1];
      cnt = 2;
    }
  }
  for (auto i : v) cout << i << " ";
}
