#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, i;
  set<int> s;
  set<int>::reverse_iterator rit;
  cin >> n;
  for (i = 0; i < n * n; i++) cin >> x, s.insert(x);
  for (rit = s.rbegin(), i = 1; rit != s.rend(), i <= n; ++rit, ++i)
    cout << *rit << " ";
  --rit;
  while (i < n) cout << *rit << " ", ++i;
}
