#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
//#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
const int maxN = 1e5 + 10;
vector < int > g[maxN];
int n;
int deg[maxN];
int h[maxN];
void dfs(int v, int p) {
    for (int to : g[v]) {
        if (to == p) continue;
        h[to] = h[v] + 1;
        dfs(to, v);
    }
}
int ndeg[maxN];
vector < int > mn(vector < int > a, vector < int > b) {
    for (int i = 0; i < n; i++) {
        if (a[i] != b[i]) {
            if (a[i] < b[i]) return a;
            else return b;
        }
    }
    return a;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
//    freopen("input.txt", "r", stdin);
    cin >> n;
    vector < pair < int, int > > eds;
    for (int i = 1; i < n; i++) {
        int a, b;
        cin >> a >> b;
        g[a].emplace_back(b);
        g[b].emplace_back(a);
        eds.emplace_back(a, b);
        deg[a]++;
        deg[b]++;
    }
    if (n == 2) {
        cout << 1 << " " << 2;
        return 0;
    }
    for (auto& it : eds) {
        if (deg[it.first] > 1 && deg[it.second] > 1) {
            ndeg[it.first]++;
            ndeg[it.second]++;
        }
    }
    int cnt = 0;
    vector < int > all;
    int who = -1;
    for (int i = 1; i <= n; i++) {
        if (deg[i] != 1) {
            cnt++;
            all.emplace_back(i);
            if (ndeg[i] <= 1) who = i;
        }
    }
    assert(who != -1);
    dfs(who, -1);
    sort(all.begin(), all.end(), [&](int a, int b) {
        return h[a] < h[b];
    });
    for (int i = 0; i + 1 < all.size(); i++) {
        if (h[all[i + 1]] != h[all[i]] + 1) {
            cout << -1 << '\n';
            return 0;
        }
        bool ok = false;
        for (int r : g[all[i]]) {
            if (r == all[i + 1]) {
                ok = true;
            }
        }
        if (!ok) {
            cout << -1 << '\n';
            return 0;
        }
    }
    /*if (all.size() == 1) {
        for (int i = 2; i <= n - 1; i++) cout << i << " ";
        cout << 1 << " " << n;
        return 0;
    }*/
    vector < int > ans(n, 1e9);
    for (int r = 0; r < 2; r++) {
        vector < int > sizes;
        sizes.emplace_back(0);
        for (int i = 0; i < all.size(); i++) {
            int c = 0;
            for (int f : g[all[i]]) {
                if (deg[f] == 1) c++;
            }
            sizes.emplace_back(c);
        }
        sizes.emplace_back(0);
        vector < int > perm;
        perm.emplace_back(n);
        int cur = n;
        sizes[sizes.size() - 2]--;
        sizes[1]--;
//        for (int u : sizes) cout << u << " ";
//        cout << endl;
        for (int i = (int)sizes.size() - 2; i >= 0; i--) {
            int ncur = cur - sizes[i] - 1;
            perm.emplace_back(ncur);
            for (int c = cur - 1; c >= ncur + 1; c--) perm.emplace_back(c);
            cur = ncur;

        }
        reverse(perm.begin(), perm.end());
        ans = mn(ans, perm);
        reverse(all.begin(), all.end());
        /*for (int a = 0; a < 2; a++) {
            for (int b = 0; b < 2; b++) {
                bool can1 = false;
                bool can2 = false;
                for (int v : g[all[0]]) {
                    if (deg[v] == 1) can1 = true;
                }
                if (a && !can1) continue;
                int c2 = 0;
                for (int v : g[all.back()]) {
                    if (deg[v] == 1) {
                        can2 = true;
                        c2++;
                    }
                }
                if ()
            }
        }*/
    }
    for (int v : ans) cout << v << " ";
    cout << '\n';
    return 0;
}

Measured memory_bytes: 19372