#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  vector<int> v(n * n);
  for (int i = 0; i < n * n; i++) cin >> v[i];
  sort(v.rbegin(), v.rend());
  int cnt = 0, r = 1e9 + 1, t;
  for (int i = 0; i < v.size(); i++) {
    if (r > v[i]) r = v[i], cout << v[i] << " ", cnt++, t = i;
    if (cnt == n) break;
  }
  while (cnt < n) cout << v[t++] << " ", cnt++;
}
