#include <bits/stdc++.h>
using namespace std;
int n, k, at, ar[1000000];
set<int> st;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n * n; i++) {
    scanf("%d", &k);
    st.insert(k);
  }
  for (set<int>::iterator it = st.end(); it != st.begin(); it--) {
    if (it == st.end()) continue;
    ar[++at] = *it;
    if (at == n) {
      break;
    }
  }
  if (at != n) {
    ar[++at] = *(st.begin());
    for (int i = at + 1; i <= n; i++) {
      ar[i] = 1;
    }
  }
  for (int i = 1; i <= n; i++) {
    printf("%d ", ar[i]);
  }
  puts("");
  return 0;
}
