#include <algorithm>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <bitset>
#define _USE_MATH_DEFINES
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double pi = 3.141592653589793;
ll mod = 1000000007;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;
ll inf = llmax / 2;

struct edge {
    int to, cost;
};

int V;
vector<edge> G[200000];
ll d[200000];
vector<int> diam;

plglg visit(int v) {
    plglg ans(0, v);
    queue<tlglglg> que;
    tlglglg start(-1, v, 0);
    d[v] = 0;
    que.push(start);
    while (que.size() > 0) {
        tlglglg p;
        p = que.front();
        que.pop();
        ll back = get<0>(p);
        ll now = get<1>(p);
        ll weight = get<2>(p);
        int n = G[now].size();
        for (int i = 0; i < n; i++) {
            edge e = G[now][i];
            if (e.to != back) {
                tlglglg pp(now, e.to, weight + e.cost);
                que.push(pp);
                d[e.to] = weight + e.cost;
                if (weight + e.cost > ans.first) {
                    ans.first = weight + e.cost;
                    ans.second = e.to;
                }
            }
        }
    }
    return ans;
}

pii farthest;

ll diameter() {
    plglg r = visit(0);
    plglg t = visit(r.second);
    farthest.first = r.second;
    farthest.second = t.second;
    int now = t.second;
    diam.push_back(now);
    ll nowdis = t.first;
    for (int i = 0; i < t.first; i++) {
        int s = G[now].size();
        for (int j = 0; j < s; j++) {
            if (d[G[now][j].to] == nowdis - G[now][j].cost) {
                nowdis -= G[now][j].cost;
                now = G[now][j].to;
                diam.push_back(now);
                break;
            }
        }
    }
    return t.first;
}

vector<int> ans;

int main() {
    int N;
    cin >> N;
    V = N;
    for (int i = 0; i < N - 1; i++) {
        int v, w;
        cin >> v >> w;
        edge e1;
        e1.to = w - 1;
        e1.cost = 1;
        G[v - 1].push_back(e1);
        edge e2;
        e2.to = v - 1;
        e2.cost = 1;
        G[w - 1].push_back(e2);
    }
    ll gdiam = diameter() + 1;
    bool ok = true;
    int onedim = 0;
    for (int i = 0; i < N; i++) {
        if (G[i].size() == 1) {
            onedim++;
        }
    }
    if (onedim != N - (gdiam - 2)) {
        ok = false;
    }
    if (!ok) {
        cout << -1 << endl;
    } else {
        bool dir = true;
        for (int i = 0; i < gdiam; i++) {
            int front = G[diam[i]].size();
            int back = G[diam[gdiam - 1 - i]].size();
            if (front > back) {
                dir = false;
                break;
            } else if (front < back) {
                break;
            }
        }
        if (dir) {
            int now = 1;
            for (int i = 0; i < gdiam; i++) {
                if (i == 0 || i == gdiam - 1) {
                    ans.push_back(now);
                    now++;
                } else {
                    int leg = G[diam[i]].size() - 2;
                    int base = now;
                    for (int j = 0; j < leg; j++) {
                        ans.push_back(now + 1);
                        now++;
                    }
                    ans.push_back(base);
                    now++;
                }
            }
        } else {
            int now = 1;
            for (int i = gdiam - 1; i >= 0; i--) {
                if (i == 0 || i == gdiam - 1) {
                    ans.push_back(now);
                    now++;
                } else {
                    int leg = G[diam[i]].size() - 2;
                    int base = now;
                    for (int j = 0; j < leg; j++) {
                        ans.push_back(now + 1);
                        now++;
                    }
                    ans.push_back(base);
                    now++;
                }
            }
        }
        for (int i = 0; i < N; i++) {
            cout << ans[i] << " ";
        }
        cout << endl;
    }
}


Measured memory_bytes: 12028