#include <bits/stdc++.h>
using namespace std;
pair<long long, bool> arr[250005];
bitset<1000000001> visited;
int main() {
  ios::sync_with_stdio(false);
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr), cout.tie(nullptr);
  long long n, temp, out = 0;
  cin >> n;
  for (long long i = 0; i < n * n; i++) cin >> arr[i].first;
  sort(arr, arr + n * n);
  while (out < n) {
    visited.reset();
    for (long long i = n * n - 1; i >= 0 && out < n; i--)
      if (!visited[arr[i].first] && !arr[i].second)
        out++, visited[arr[i].first] = arr[i].second = 1,
               cout << arr[i].first << " ";
  }
  cout << endl;
  return 0;
}
