// Original C++ solution (slower):
#include<bits/stdc++.h>

#define rep(i,a,b) for(int i=(a);i<=(b);i++)

#define per(i,a,b) for(int i=(a);i>=(b);i--)

#define REP(i,n) for(int i=(0);i<(n);i++)

#define fi first

#define se second

#define pb push_back

#define mp make_pair

using namespace std;

typedef pair<int,int> pii;

typedef vector<int> vi;

typedef long long ll;

typedef double ld;

 

template<class T> inline void read(T &x){

	int f=0;x=0;char ch=getchar();

	for(;!isdigit(ch);ch=getchar())f|=(ch=='-');

	for(;isdigit(ch);ch=getchar())x=x*10+ch-'0';

	if(f)x=-x;

}



const int N=100005;

int fa[N],d[N],a[N],cur[N],c[N],tmp[N],ans[N];

int num,pos,cnt,s,t,n,m,u,v;

vi e[N];



void dfs(int u){

	for(auto v:e[u])

		if(v!=fa[u]){

			d[v]=d[u]+1;

			fa[v]=u,dfs(v);

		}

}



int cmp(int *a,int *b){

	rep(i,1,cnt)

		if(a[i]!=b[i])return a[i]<b[i];

	return 0;

}



int main(){

	read(n);

	rep(i,1,n-1){

		read(u),read(v);

		e[u].pb(v),e[v].pb(u);

	}

	fa[1]=0,d[1]=1,dfs(1);

	s=max_element(d+1,d+n+1)-d;

	fa[s]=0,d[s]=1,dfs(s);

	t=max_element(d+1,d+n+1)-d;

	a[++cnt]=t;

	while(a[cnt]!=s){

		int t=fa[a[cnt]];

		a[++cnt]=t;

	}

	rep(i,1,cnt)cur[a[i]]=i;

	rep(i,1,n)

		if(!cur[i]){

			if(a[cur[fa[i]]]!=fa[i])

				return puts("-1"),0;

			cur[i]=cur[fa[i]];

			++c[cur[i]];

		}

	memcpy(tmp,c,sizeof c);

	reverse(tmp+1,tmp+cnt+1);

	if(cmp(tmp,c))memcpy(c,tmp,sizeof tmp);

	rep(i,1,cnt){

		int tmp=++num;

		rep(j,1,c[i])

			ans[pos+j]=++num;

		pos+=c[i]+1;

		ans[pos]=tmp;

	}

	rep(i,1,n)printf("%d ",ans[i]);

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<iostream>

#include<cstdlib>

#include<cstring> 

#include<algorithm>

#include<queue>

#include<vector>

#include<ctime>

using namespace std;

typedef long long ll;

const int N = 200010;

ll read() {

	ll x = 0,f = 1;char c = getchar();

	while(c < '0' || c > '9') {

		if(c == '-') f = -1; c = getchar();

	}

	while(c >= '0' && c <= '9') {

		x = x * 10 + c - '0'; c = getchar();

	}

	return x * f;

}

struct node {

	int v,nxt;

}e[N << 1];

int du[N],ejs,head[N];

void add(int u,int v) {

	e[++ejs].v = v;e[ejs].nxt = head[u];head[u] = ejs;

}

int n,dis[N];

void dfs(int u,int fa) {

	for(int i = head[u];i;i = e[i].nxt) {

		int v = e[i].v;if(v == fa) continue;

		dis[v] = dis[u] + 1;

		dfs(v,u);

	}

}

int zj[N],tot;

bool get(int u,int fa,int T) {

	if(u == T) {

		zj[++tot] = T;

		return true;

	}

	for(int i = head[u];i;i = e[i].nxt) {

		int v = e[i].v;if(v == fa) continue;

		if(get(v,u,T)) {

			zj[++tot] = u;

			return true;

		}

	}

	return false;

}

int ans[N];

int main() {

	n = read();

	for(int i = 1;i < n;++i) {

		int u = read(),v = read();add(v,u);add(u,v);

		du[u]++;du[v]++;

	}

	

	dfs(1,0);

	int tmp = 0;

	for(int i = 1;i <= n;++i)

		if(dis[i] > dis[tmp]) tmp = i;

	dis[tmp] = 0;

	dfs(tmp,0);

	int tt = 0;

	for(int i = 1;i <= n;++i) 

		if(dis[i] > dis[tt]) tt = i;

	get(tmp,0,tt);

	

	int flag = 0;

	for(int i = 1;i <= tot;++i) {

		if(du[zj[i]] < du[zj[tot - i + 1]]) break;

		if(du[zj[i]] > du[zj[tot - i + 1]]) {

			flag = 1;break;

		}

	}

	if(flag) {

		for(int i = 1;i <= tot / 2;++i) swap(zj[i],zj[tot - i + 1]);

	}

	

	int pos = 0,now = 0;

	

	ans[++pos] = ++now;

	for(int i = 2;i < tot;++i) {

		int tmp = ++now;

		for(int j = 1;j < du[zj[i]] - 1;++j) ans[++pos] = ++now;

		ans[++pos] = tmp;

	}

	ans[++pos] = ++now;

	if(pos != n) {

		puts("-1");return 0;

	}

	for(int i = 1;i <= pos;++i) printf("%d ",ans[i]);

	return 0;

}


// Fastest known solution for this problem: