#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
const int MX = 100005;
int n, v, u, c = 2;
vector<int> G[MX], a;
int dfs1(int u, int p){
	int c = u != v, ret = u;
	for(int nx: G[u]) if(nx != p && G[nx].size() > 1){
		if(c++ > 1){
			puts("-1");
			exit(0);
		}
		ret = dfs1(nx,u);
	}
	return ret;
}
void dfs2(int u, int p){
	a.push_back((int)G[u].size());
	for(int nx: G[u]) if(nx != p && G[nx].size() > 1) dfs2(nx,u);
}
int main(){
	scanf("%d", &n);
	rep(i,n-1){
		scanf("%d%d", &v, &u);
		v--; u--;
		G[v].push_back(u);
		G[u].push_back(v);
	}
	if(G[v].size() == 1) v = G[v][0];
	v = dfs1(v,-1);
	dfs2(v,-1);
	u = (int)a.size();
	rep(i,u) if(a[i] != a[u-1-i]){
		if(a[i] > a[u-1-i]) reverse(a.begin(), a.end());
		break;
	}
	printf("1 ");
	rep(i,u){
		int t = c++;
		rep(j,a[i]-2) printf("%d ", c++);
		printf("%d ", t);
		if(i == u-1) printf("%d\n", c++);
	}
}