#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimize("unroll-loops")
using namespace std;
template <typename T1, typename T2>
inline void chmin(T1& a, T2 b) {
  if (a > b) a = b;
}
template <typename T1, typename T2>
inline void chmax(T1& a, T2 b) {
  if (a < b) a = b;
}
std::random_device rd;
std::mt19937 mt(rd());
constexpr long long MOD = 1e9 + 7;
constexpr long long MAX = 500000;
const double pi = acos(-1);
constexpr double EPS = 1e-8;
constexpr long long LINF = 1e17 + 1;
constexpr long long INF = 1e9 + 1;
void solve() {
  map<long long, long long> cnt;
  long long N;
  cin >> N;
  vector<long long> A(N * N);
  multiset<long long> st;
  for (long long i = 0; i < (N * N); ++i) {
    cin >> A[i];
    cnt[A[i]]++;
    st.insert(A[i]);
  }
  vector<long long> ans;
  while (st.size() > N) {
    auto itr = st.begin();
    long long val = *itr;
    if (cnt[val] >= 2) {
      cnt[val] -= 2;
      itr = st.erase(itr);
      itr = st.erase(itr);
    } else {
      itr = st.erase(itr);
      st.insert(val + INF);
    }
  }
  for (auto x : st) {
    ans.push_back(x > INF ? x - INF : x);
  }
  for (long long i = 0; i < (ans.size()); ++i)
    cout << ans[i] << " \n"[i == (long long)ans.size() - 1];
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  solve();
}
