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


int n;
vector<int>G[101000], G2[101000], ans, vec;

void dfs(int x,int fff){
    vec.push_back(G[x].size()-1);
    for (auto y:G2[x])
        if (y!=fff)
            dfs(y,x);
}
vector<int> fuck(int s){
    vec.clear();
    vec.push_back(1);
    dfs(s,0);
    vec.push_back(1);
    vector<int>res(n,0);
    int las=0;
    for (auto o:vec){
        int p=las;
        res[las+o-1]=p++;
        for (int i=0;i<o-1;++i)
            res[las+i]=p++;
        las=p;
    }
    return res;
}

int main(){
    cin>>n;
    for (int i=1;i<n;++i){
        int u, v; cin>>u>>v;
        G[u].push_back(v);
        G[v].push_back(u);
    }
    if (n==2){
        puts("1 2");
        return 0;
    }
    for (int i=1;i<=n;++i)
        for (auto j:G[i])
            if (G[i].size()>1&&G[j].size()>1)
                G2[j].push_back(i);
    for (int i=1;i<=n;++i)
        if (G2[i].size()>2){
            puts("-1");
            return 0;
        }
    ans.push_back(n+1);
    for (int i=1;i<=n;++i)
        if (G2[i].size()==1)
            ans=min(ans,fuck(i));
    if (ans[0]==n+1)
        for (int i=1;i<=n;++i)
            if (G[i].size()>1)
                ans=min(ans,fuck(i));
    for (auto o:ans)
        printf("%d ",o+1);
    puts("");
}