#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const long long INF = 1e18;
const long double PI = 4 * atan((long double)1);
const int INFTY = 1e7;
int main() {
  long long n;
  cin >> n;
  set<int, greater<int>> second;
  long long nsq = n * n;
  long long x;
  for (int i = 0; i < (nsq); i++) cin >> x, second.insert(x);
  int c = 0;
  for (const auto& v : second) {
    cout << v << " ";
    c++;
    if (c == n) break;
  }
  cout << endl;
}
