#include<bits/stdc++.h>
#define FOR(i, n, m) for(int i = n; i < (int)m; i++)
#define REP(i, n) FOR(i, 0, n)
#define all(v) v.begin(), v.end()
#define pb push_back
using namespace std;
using ll = std::int_fast64_t;
using pi = pair<ll, ll>;
constexpr ll inf = 1000000000;
constexpr ll mod = 1000000007;
constexpr long double eps = 1e-15;
template<typename T1, typename T2>
ostream& operator<<(ostream& os, pair<T1, T2> p) {
	os << to_string(p.first) << " " << to_string(p.second);
	return os;
}
template<typename T>
ostream& operator<<(ostream& os, vector<T>& v) {
	REP(i, v.size()) {
		if(i) os << " ";
		os << to_string(v[i]);
	}
	return os;
}


//number//
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}

struct modint {
	ll n;
public:
	modint(const ll n = 0) : n((n % mod + mod) % mod) {}
	static modint pow(modint a, ll m) {
		modint r = 1;
		while(m > 0) {
			if(m & 1) { r *= a; }
			a = (a * a); m /= 2;
		}
		return r;
	}
	modint &operator++() { *this += 1; return *this; }
	modint &operator--() { *this -= 1; return *this; }
	modint operator++(int) { modint ret = *this; *this += 1; return ret; }
	modint operator--(int) { modint ret = *this; *this -= 1; return ret; }
	modint operator~() const { return (this -> pow(n, mod - 2)); } // inverse
	friend bool operator==(const modint& lhs, const modint& rhs) {
		return lhs.n == rhs.n;
	}
	friend bool operator<(const modint& lhs, const modint& rhs) {
		return lhs.n < rhs.n;
	}
	friend bool operator>(const modint& lhs, const modint& rhs) {
		return lhs.n > rhs.n;
	}
	friend modint &operator+=(modint& lhs, const modint& rhs) {
		lhs.n += rhs.n;
		if (lhs.n >= mod) lhs.n -= mod;
		return lhs;
	}
	friend modint &operator-=(modint& lhs, const modint& rhs) {
		lhs.n -= rhs.n;
		if (lhs.n < 0) lhs.n += mod;
		return lhs;
	}
	friend modint &operator*=(modint& lhs, const modint& rhs) {
		lhs.n = (lhs.n * rhs.n) % mod;
		return lhs;
	}
	friend modint &operator/=(modint& lhs, const modint& rhs) {
		lhs.n = (lhs.n * (~rhs).n) % mod;
		return lhs;
	}
	friend modint operator+(const modint& lhs, const modint& rhs) {
		return modint(lhs.n + rhs.n);
	}
	friend modint operator-(const modint& lhs, const modint& rhs) {
		return modint(lhs.n - rhs.n);
	}
	friend modint operator*(const modint& lhs, const modint& rhs) {
		return modint(lhs.n * rhs.n);
	}
	friend modint operator/(const modint& lhs, const modint& rhs) {
		return modint(lhs.n * (~rhs).n);
	}
};
istream& operator>>(istream& is, modint m) { is >> m.n; return is; }
ostream& operator<<(ostream& os, modint m) { os << m.n; return os; }

struct binomial_coefficient {
private:
	int m;
	vector<modint> fact;
public:
	binomial_coefficient(int m) : m(m) {
		fact.resize(m);
		fact[0] = 1;
		for(int i = 1; i < m; i++) fact[i] = fact[i - 1] * i;
	}
	modint combination(int n, int k) {
		if(n < 0 || k < 0 || n < k) return 0;
		return fact[n] / fact[n - k] / fact[k];
	}
};


// graph //
using weight = long long;
template <typename T> struct edge { int to; weight w; T v; };

template <typename T> struct vgraph {
protected:
	int n;
	bool weighted;
	vector<vector<edge<T>>> g;
public:
	vgraph(int n) : n(n), weighted(false), g(vector<vector<edge<T>>>(n)) { }
	int size() { return size; }
	bool isweighted() { return weighted; }
	void add_edge(int s, int t, T v, weight w = 1) {
		g[s].push_back({t, w, v});
		g[t].push_back({s, w, v});
		if(w != 1) weighted = true;
	}
	void add_dedge(int s, int t, T v, weight w = 1) {
		g[s].push_back({t, w, v});
		if(w != 1) weighted = true;
	}
	vector<edge<T>>& operator[] (int i) { return g[i]; }
};

struct ugraph : vgraph<void*> {
public:
	ugraph(int n) : vgraph<void*>(n) { }
	void add_edge(int s, int t, weight w = 1) {
		vgraph::add_edge(s, t, nullptr, w);
	}
	void add_dedge(int s, int t, weight w = 1) {
		vgraph::add_dedge(s, t, nullptr, w);
	}
};

template <typename T>
vector<weight> shortest_path(vgraph<T>& g, int s) {
	int n = g.size();
	vector<weight> path(n, -1);
	if(g.isweighted()) { // dijkstra
		priority_queue<pair<weight, int>, vector<pair<weight, int>>, greater<pair<weight, int>>> q;
		path[s] = 0;
		q.push({0, s});
		while(!q.empty()) {
			weight cost = q.top().first;
			int p = q.top().second;
			q.pop();
			if(path[p] != cost) continue;
			for(auto e: g[p]) {
				if(path[e.to] == -1 || path[e.to] > cost + e.w) {
					path[e.to] = cost + e.w;
					q.push({path[e.to], e.to});
				}
			}
		}
	} else { // bfs
		queue<int> q;
		path[s] = 0;
		q.push(s);
		while(!q.empty()) {
			int p = q.front();
			q.pop();
			for(auto e: g[p]) {
				if(path[e.to] == -1) {
					path[e.to] = path[p] + 1;
					q.push(e.to);
				}
			}
		}
	}
	return path;
}


void dfs(int v, int p, ugraph& g, vector<int>& a, int c) {
	if(p != -1 && (int)g[v].size() == 1) return;
	if(p == -1) {
		REP(i, g[v].size() - 1) a.pb(c + 1 + i);
		a.pb(c);
		c += (int)g[v].size();
	} else {
		REP(i, g[v].size() - 2) a.pb(c + 1 + i);
		a.pb(c);
		c += (int)g[v].size() - 1;
	}
	for(auto e: g[v]) {
		if(e.to == p) continue;
		dfs(e.to, v, g, a, c);
	}
	return;
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	using mi = modint;
	int n;
	cin >> n;
	ugraph t(n);
	REP(i, n - 1) {
		int v, w;
		cin >> v >> w;
		t.add_edge(--v, --w);
	}
	if(n == 2) {
		cout << 1 << " " << 2 << endl;
		return 0;
	}
	vector<bool> isleaf(n, false);
	REP(i, n) {
		if((int)t[i].size() == 1) isleaf[i] = true;
	}
	vector<int> c(n, 0);
	REP(i, n) for(auto e: t[i]) {
		if(isleaf[e.to]) c[i]++;
	}
	vector<int> c1, c2, c3;
	REP(i, n) {
		if(isleaf[i]) continue;
		int tmp = 0;
		for(auto e: t[i]) {
			if(!isleaf[e.to]) tmp++;
		}
		if(tmp == 1) c1.pb(i);
		if(tmp == 2) c2.pb(i);
		if(tmp > 2) c3.pb(i);
	}
	if(!c3.empty()) {
		cout << -1 << endl;
		return 0;
	}
	vector<int> ans;
	if((int)c1.size() == 0) {
		ans.pb(1);
		FOR(i, 3, n) ans.pb(i);
		ans.pb(2);
	} else {
		int p1 = -1, p2 = -1;
		for(auto e: t[c1[0]]) {
			if(isleaf[e.to]) p1 = e.to;
		}
		for(auto e: t[c1[1]]) {
			if(isleaf[e.to]) p2 = e.to;
		}
		vector<int> v1; dfs(p1, -1, t, v1, 1);
		vector<int> v2; dfs(p2, -1, t, v2, 1);
		REP(i, n) {
			if(v1[i] < v2[i]) {
				ans = v1;
				break;
			}
			if(v2[i] < v1[i]) {
				ans = v2;
				break;
			}
		}
		if(ans.empty()) ans = v1;
	}
	ans.pb(n);
	cout << ans << endl;
	return 0;
}

// ---------------------------------------


Measured memory_bytes: 20728