#include <bits/stdc++.h>
using namespace std;

const int N=1e5+5;

struct Edge { int v; Edge *nxt; } edge[N<<1],*head[N];
int n,fa[N],Size[N],per[N],f1[N],f2[N],cnt_edge,cnt_per,max_dist;

inline void addedge(int u,int v){
    edge[++cnt_edge].v=v; Size[u]++;
    edge[cnt_edge].nxt=head[u],head[u]=&edge[cnt_edge];
}

inline void Diam_DFS(int now,int from,int dist,int &max_dist,int &t){
    fa[now]=from;
    if (dist>max_dist) max_dist=dist,t=now;
    for (register Edge *u=head[now];u;u=u->nxt)
        if (u->v!=from) Diam_DFS(u->v,now,dist+1,max_dist,t);
}

inline pair <int,int> Diameter(){
    int s=1,t=1;
    Diam_DFS(s,0,0,max_dist=0,t);
    s=t;
    Diam_DFS(s,0,0,max_dist=0,t);
    return make_pair(s,t);
}

int main(){
    scanf("%d",&n);
    for (register int i=1,u,v;i<n;i++)
        scanf("%d%d",&u,&v),addedge(u,v),addedge(v,u);
    pair <int,int> p=Diameter();
    int s=p.second,t=p.first,past=0;
    while (1){
        cnt_per++;
        for (register Edge *u=head[s];u;u=u->nxt)
            if (Size[u->v]>1&&u->v!=fa[s]&&u->v!=past){ printf("-1\n"); return 0; }
            else if (u->v!=fa[s]&&u->v!=past) per[cnt_per]++;
        if (s==t) break;
        past=s,s=fa[s];
    }
    for (register int i=1,sum1=1,sum2=1;i<=cnt_per;i++,sum1++,sum2++){
        for (register int j=1;j<=per[i];j++,sum1++)
            f1[sum1]=sum1+1; f1[sum1]=sum1-per[i];
        for (register int j=1;j<=per[cnt_per-i+1];j++,sum2++)
            f2[sum2]=sum2+1; f2[sum2]=sum2-per[cnt_per-i+1];
    }
    for (register int i=1;i<=n;i++)
        if (f1[i]<f2[i]){ for (register int j=1;j<=n;j++) printf("%d ",f1[j]); putchar('\n'); return 0; }
        else if (f2[i]<f1[i]){ for (register int j=1;j<=n;j++) printf("%d ",f2[j]); putchar('\n'); return 0; }
    for (register int j=1;j<=n;j++) printf("%d ",f1[j]); putchar('\n');
    return 0;
}