#include <bits/stdc++.h>

#define pb push_back

#define MAX_N 100000

using namespace std;

int n;

vector <int> g[MAX_N + 1];

void add(int a, int b)
{
    g[a].pb(b);
}

int viz[MAX_N + 1];
int dist[MAX_N + 1];
int luat[MAX_N + 1];
int leg[MAX_N + 1];
int perm[MAX_N + 1];
int cr[MAX_N + 1];
int poz[MAX_N + 1];

int k;
int org[MAX_N + 1];

void readFile()
{
    cin >> n;

    int i;
    int a, b;
    for(i = 1; i < n; i ++)
    {
        cin >> a >> b;
        add(a, b);
        add(b, a);
    }
}

void dfs(int a)
{
    viz[a] = 1;
    for(auto u : g[a])
    {
        if(viz[u] == 0)
        {
            dist[u] = dist[a] + 1;
            dfs(u);
        }
    }
}

int st, dr;

void dfsDrum(int a, int &okIN)
{
    viz[a] = 1;

    for(auto u : g[a])
    {
        if(viz[u] == 0)
        {
            int ok2 = 0;
            dfsDrum(u, ok2);

            if(ok2 == 1)
                okIN = 1;
        }
    }

    if(a == dr)
        okIN = 1;

    if(okIN == 1)
        luat[a] = 1;
}

void copyV(int a[], int b[])
{
    int i;
    for(i = 1; i <= n; i ++)
        a[i] = b[i];
}

void getMn(int a[], int b[])
{
    int i;
    for(i = 1; i <= n; i ++)
    {
        if(b[i] < a[i])
        {
            copyV(a, b);

            return;
        }

        if(a[i] < b[i])
            return;
    }
}

void dfsBuild(int a)
{
    viz[a] = 1;

    int legs = 0;
    for(auto u : g[a])
    {
        if(luat[u] == 0)
            legs ++;
    }

    int cod = (++ k);

    if(legs > 0)
    {
        k += legs;
        int i;
        for(i = poz[cod]; i < poz[cod] + legs; i ++)
        {
            cr[i] = cr[i + 1];
            poz[cr[i]] = i;
        }
    }

    cr[poz[cod] + legs] = cod;
    poz[cod] = poz[cod] + legs;


    for(auto u : g[a])
    {
        if(luat[u] == 1 && viz[u] == 0)
        {
            dfsBuild(u);
        }
    }
}

void init0()
{
    int i;
    for(i = 1; i <= n; i ++)
    {
        cr[i] = i;
        poz[i] = i;
    }

    k = 0;
    memset(viz, 0, sizeof(viz));
}

void getDiam()
{
    dfs(1);

    int i;
    int mx = 0;
    for(i = 1; i <= n; i ++)
    {
        if(dist[i] > mx)
        {
            mx = dist[i];
            st = i;
        }
    }

    memset(viz, 0, sizeof(viz));
    memset(dist, 0, sizeof(dist));

    dfs(st);

    mx = 0;
    for(i = 1; i <= n; i ++)
    {
        if(dist[i] > mx)
        {
            mx = dist[i];
            dr = i;
        }
    }
}

void getDrum()
{
    memset(viz, 0, sizeof(viz));

    int nr = 0;
    dfsDrum(st, nr);

    int i;
    for(i = 1; i <= n; i ++)
    {
        int ok = luat[i];
        for(auto u : g[i])
            ok = ok || (luat[u] == 1);

        if(ok == 0)
        {
            cout << "-1\n";

            exit(0);
        }

        perm[i] = n + 10;
    }
}

void getRez()
{
    init0();
    dfsBuild(st);
    copyV(perm, cr);

    init0();
    dfsBuild(dr);
    getMn(perm, cr);
}

void solve()
{
    getDiam();

    getDrum();

    getRez();
}

void printFile()
{
    int i;
    for(i = 1; i <= n; i ++)
        cout << perm[i] << " ";
    cout << "\n";
}

int main()
{
    readFile();

    solve();

    printFile();

    return 0;
}


Measured memory_bytes: 14848