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