#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);
  for (int i = 1; out < n && i <= n * n; i++)
    if (!visited[arr[n * n - i].first])
      cout << arr[n * n - i].first << " ",
          arr[n * n - i].second = visited[arr[n * n - i].first] = 1, out++;
  if (out != n)
    for (int i = 1; out < n && i <= n * n; i++)
      if (!arr[n * n - i].second) cout << arr[n * n - i].first << " ";
  cout << endl;
  return 0;
}
