#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
#include<complex>
using namespace std;

#define rep(i,x) for(ll i=0;i<x;i++)
#define repn(i,x) for(ll i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 1000000007;
const ll MAX = 4000001;
const double eps = 1E-18;

ll max(ll a, ll b) {
	if (a > b) { return a; }
	return b;
}

ll min(ll a, ll b) {
	if (a > b) { return b; }
	return a;
}

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

ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}

struct edge {
	ll ind;
	ll fr;
	ll to;
	ll d;
};

class mint {
	long long x;
public:
	mint(long long x = 0) : x((x% MOD + MOD) % MOD) {}
	mint operator-() const {
		return mint(-x);
	}
	mint& operator+=(const mint& a) {
		if ((x += a.x) >= MOD) x -= MOD;
		return *this;
	}
	mint& operator-=(const mint& a) {
		if ((x += MOD - a.x) >= MOD) x -= MOD;
		return *this;
	}
	mint& operator*=(const  mint& a) {
		(x *= a.x) %= MOD;
		return *this;
	}
	mint operator+(const mint& a) const {
		mint res(*this);
		return res += a;
	}
	mint operator-(const mint& a) const {
		mint res(*this);
		return res -= a;
	}
	mint operator*(const mint& a) const {
		mint res(*this);
		return res *= a;
	}

	mint operator^(const ll& t)const {
		if (!t) return 1;
		mint a = pow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}

	mint pow(ll t) const {
		if (!t) return 1;
		mint a = pow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}
	// for prime MOD
	mint inv() const {
		return pow(MOD - 2);
	}
	mint& operator/=(const mint& a) {
		return (*this) *= a.inv();
	}
	mint operator/(const mint& a) const {
		mint res(*this);
		return res /= a;
	}

	friend ostream& operator<<(ostream& os, const mint& m) {
		os << m.x;
		return os;
	}
};

///////////////////////////

vector<ll> perm(vector<ll> &a) {
	ll M = a.size();
	vector<ll> rui(M+1);
	rui[0] = 0;
	repn(i, M) { rui[i] = rui[i - 1] + a[i - 1] + 1;}

	vector<ll> ret;

	rep(i, M) {
		for (ll j =rui[i]+2 ; j <= rui[i+1]; j++) { ret.push_back(j); }
		ret.push_back(rui[i] + 1);
	}

	
	return ret;
}

int main() {
	ll N;
	cin >> N;

	vector<vector<ll>> g(N + 1);
	vector<vector<ll>> h(N + 1);

	repn(i, N - 1) {
		ll u, v;
		cin >> u >> v;
		g[u].push_back(v);
		g[v].push_back(u);
	}

	repn(v, N) {
		for (ll w : g[v]) {
			if (g[v].size() >= 2 && g[w].size() >= 2) {
				h[v].push_back(w);
			}
		}
	}

	ll e = 0;
	repn(v, N) {
		if (h[v].size() >= 3) { cout << -1; return 0; }
		if (h[v].size() == 1) { e = v; }
	}

	vector<ll> path;
	path.push_back(0);
	ll v = e;
	ll u = 0;

	if (e != 0) {
		while (1) {
			path.push_back(g[v].size() - h[v].size());
			if (h[v].size() == 1 && v != e) { break; }
			for (ll w : h[v]) { if (w != u) { u = v; v = w; break; } }
		}
	}
	if (e == 0) { path.push_back(N - 1); }

	path.push_back(0);

	path[1]--;
	path[path.size() - 2]--;

	//rep(i, path.size()) { cout << path[i] << endl; }

	vector<ll> perm1 = perm(path);
	reverse(path.begin(), path.end());
	vector<ll> perm2 = perm(path);
	vector<ll> ans = min(perm1, perm2);

	rep(i, N) cout << ans[i] << " ";
	

	
	
	system("PAUSE");

}

Measured memory_bytes: 15336