#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define x first
#define y second
#define pii pair<int, int>
#define p3i pair<pii, int>
#define pll pair<ll, ll>
#define p3l pair<pll, ll>
#define vi vector<int>
#define vpii vector<pii>
#define vp3i vector<p3i>
#define vpll vector<pll>
#define vp3l vector<p3l>
#define lseg L, (L+R)/2, N*2+1
#define rseg (L+R)/2+1, R, N*2+2
#define ub upper_bound
#define lb lower_bound
#define pq priority_queue
#define MN 1000000007
#define fox(k, x) for (int k=0; k<x; ++k)
#define fox1(k, x) for (int k=1; k<=x; ++k)
#define foxr(k, x) for (int k=x-1; k>=0; --k)
#define fox1r(k, x) for (int k=x; k>0; --k)
#define ms multiset
#define flood(x) memset(x, 0x3f3f3f3f, sizeof x)
#define drain(x) memset(x, 0, sizeof x)
#define rng() ((rand() << 14)+rand())
#define scan(X) do{while((X=getchar())<'0'); for(X-='0'; '0'<=(_=getchar()); X=(X<<3)+(X<<1)+_-'0');}while(0)
char _;
#define pi 3.14159265358979323846

int n, x, y, p, dp[100005], c[100005];
vector<int> v[100005];
void dfs(int N, int P){
    fox(l, v[N].size()){
        if (v[N][l]==P) continue;
        dfs(v[N][l], N);
        if (v[v[N][l]].size()>1){
            dp[N]|=dp[v[N][l]];
            c[N]++;
        }
    }
    dp[N]|=(c[N]>1);
}
vector<int> s, s2;
void solve(int N, int P, bool first=1){
    int t=++p;
    //s2.clear();
    bool last=1;
    fox(l, v[N].size()){
        if (v[N][l]==P) continue;
        if (v[v[N][l]].size()!=1){
            last=0;
        }
    }
    fox(l, v[N].size()){
        if (v[N][l]==P) continue;
        if (v[v[N][l]].size()==1){
            if (first){
                first=0;
                s.pb(t);
                ++t; ++p;
                continue;
            }
            s.pb(++p);
            //cout << "^";
        }
    }
    //cout << N << endl;
    if (last && v[N].size()>1){
        int t2=s.back();s.pop_back();
        s.pb(t);
        s.pb(t2);
        //cout << "*";
    } else
    s.pb(t);
    int k=0;
    fox(l, v[N].size()){
        if (v[N][l]==P) continue;
        if (v[v[N][l]].size()!=1){
            solve(v[N][l], N, 0);
            ++k;
            if (k>1) exit(1);
        }
    }
}
void dfs2(int N, int P, bool T){
    if (dp[N]==0 && T==0 || c[N]==0){
        solve(N, -1);
        //cout << "*" << N << endl;
        fox(l, s.size()) cout << s[l] << ' ';
        exit(0);
    }
    if (c[N]+T>2) return;
    if (P==-1 && v[N].size()==1){
        dfs2(v[N][0], N, 0);
        return;
    }
    int c2=0;
    fox(l, v[N].size()){
        if (v[N][l]==P) continue;
        if (v[v[N][l]].size()>1){
            c2+=dp[v[N][l]];
        }
    }
    fox(l, v[N].size()){
        if (v[N][l]==P) continue;
        if (v[v[N][l]].size()>1 && c2-dp[v[N][l]]==0){
            dfs2(v[N][l], N, 1);
        }
    }
}
int32_t main(){
    cin >> n;
    if (n==2){
        cout << "1 2";
        return 0;
    }
    fox(l, n-1){
        cin >> x >> y;
        v[x].pb(y);
        v[y].pb(x);
    }
    fox1(l, n){
        int c=0;
        fox(l2, v[l].size()){
            if (v[v[l][l2]].size()>1) c++;
        }
        if (c>2){
            cout << -1;
            return 0;
        }
    }
    fox1(l, n){
        int c=0;
        if (v[l].size()==1) continue;
        fox(l2, v[l].size()){
            if (v[v[l][l2]].size()>1) c++;
        }
        if (c<=1){
            //cout << "*";
            //cout << l << endl;
            s2=s;
            s.clear(); p=0;
            solve(l, -1);
            //fox(l, s.size()) cout << s[l] << ' '; cout << endl;
            //return 0;
        }
    }
    if (s2.size())
        s=min(s, s2);
    fox(l, s.size()) cout << s[l] << ' ';
    return 0;
    //dfs(1, -1);
    //dfs2(1, -1, 0);
    cout << -1;
    return 0;
}


Measured memory_bytes: 16632