#include <bits/stdc++.h>
#ifndef Local
#define debug(...) 1337
#define endl '\n'
#endif

using namespace std;

#define int long long

typedef long long ll;
typedef long double ld;

#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()

template <typename T, typename U>
bool smin(T& a, U b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}

template <typename T, typename U>
bool smax(T& a, U b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}

void solve() {
	int n;
	cin >> n;
	int l = __lg(n + 1);
	n = 1 << (l - 1);
	vector<int> a(2 * n - 1);
	map<int, int> cnt;
	map<int, vector<int>> ms;
	for (int& i : a)
		cin >> i, ++cnt[i];
	for (auto& [k, el] : cnt)
		ms[el].push_back(k);
	vector<int> ans(n);
	for (int i = 2, j = 1; i <= (1ll << l); i <<= 1, ++j) {
		sort(all(ms[j]));
		reverse(all(ms[j]));
		for (int p = i / 2; p < n; p += i) {
			if (!sz(ms[j])) {
				cout << -1 << endl;
				return;
			}
			ans[p] = ms[j].back();
			ms[j].pop_back();
		}
	}
	if (ms[l].empty()) {
		cout << -1 << endl;
		return;
	}
	ans[0] = ms[l].front();

	vector<int> used;
	for (int i = 0; i < l; ++i) {
		for (int j = 0; j < n; j += (1 << i)) {
			int minn = 1e9;
			for (int k = j; k < j + (1 << i); ++k) {
				minn = min(minn, ans[k]);
			}
			used.push_back(minn);
		}
	}

	std::sort(a.begin(), a.end());
	std::sort(used.begin(), used.end());

	if (a != used){
		cout << -1 << endl;
		return;
	}
	for (int& i : ans)
		cout << i << ' ';
	cout << endl;
}

signed main() {
	ios::sync_with_stdio(false), cin.tie(nullptr);

	int tt = 1;
	// cin >> tt;
	while (tt--)
		solve();

	return 0;
}
