/*
考虑一个排列造出来的树，
找规律知，其以所有后缀 min 作为主干依次连接，其余点与后面第一个树干上的位置连边；
据此规律，直接拿出模板树的直径进行构造即可。 
*/
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;

int n, pu, pv, mxdep;
vector<int> fa;
vector<vector<int>> G;

void dfs(int u, int par, int dep)
{
	if(!pu || dep > mxdep)
		mxdep = dep, pu = u;
	for(auto &v : G[u])
		if(v ^ par)
			dfs(v, u, 1 + dep);
}

void dfs1(int u, int par, int dep)
{
	if(!pv || dep > mxdep)
		mxdep = dep, pv = u;
	fa[u] = par;
	for(auto &v : G[u])
		if(v ^ par)
			dfs1(v, u, 1 + dep);
}

int main()
{
	scanf("%d", &n);
	G.resize(n + 1);
	for(int i = 1, a, b; i < n; ++i)
	{
		scanf("%d %d", &a, &b);
		G[a].push_back(b);
		G[b].push_back(a);
	}
	dfs(1, 0, 0);
	fa.resize(n + 1);
	dfs1(pu, 0, 0);
	vector<int> v, a, b;
	for(int x = pv; x; x = fa[x]) v.push_back(x);
	int ind = 0;
	for(auto &p : v)
	{
		int t = G[p].size() + 1 - (p != v.front()) - (p != v.back()), nn = ++ind;
		for(int j = t - 1; j; --j) a.push_back(++nn);
		a.push_back(ind), ind = nn;
	}
	reverse(v.begin(), v.end());
	ind = 0;
	for(auto &p : v)
	{
		int t = G[p].size() + 1 - (p != v.front()) - (p != v.back()), nn = ++ind;
		for(int j = t - 1; j; --j) b.push_back(++nn);
		b.push_back(ind), ind = nn;
	}
	
	if((int)a.size() != n || (int)b.size() != n)
		return puts("-1"), 0;
	
	for(int i = 0; i < n; ++i)
	{
		if(a[i] < b[i]) break;
		if(b[i] < a[i]) { a.swap(b); break; }
	}
	
	for(auto x : a) printf("%d ", x);
}