#include <bits/stdc++.h>
#define all(vec) vec.begin(), vec.end()
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
constexpr ll INF = (1LL << 30) - 1LL;
constexpr ll LINF = (1LL << 60) - 1LL;
constexpr double eps = 1e-9;
constexpr ll MOD = 1000000007LL;
template <typename T>
bool chmin(T& a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
};
template <typename T>
bool chmax(T& a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
};
template <typename T>
ostream& operator<<(ostream& os, vector<T> v) {
    for(int i = 0; i < v.size(); i++) {
        os << v[i] << (i + 1 == v.size() ? "\n" : " ");
    }
    return os;
}
template <typename T>
vector<T> make_v(size_t a) {
    return vector<T>(a);
}
template <typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
    return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template <typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type fill_v(T& t, const V& v) {
    t = v;
}
template <typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type fill_v(T& t, const V& v) {
    for(auto& e : t) {
        fill_v(e, v);
    }
};
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<int> t, f(n);
    vector<vector<int>> G(n);
    for(int i = 0; i < n - 1; i++) {
        int u, v;
        cin >> u >> v;
        --u;
        --v;
        G[u].push_back(v);
        G[v].push_back(u);
    }
    for(int i = 0; i < n; i++) {
        if(G[i].size() == 1) {
            f[i] = 1;
        }
    }
    int r = -1;
    for(int i = 0; i < n; i++) {
        if(!f[i]) {
            int c = 0;
            for(auto& e : G[i]) {
                if(!f[e]) {
                    c++;
                }
            }
            if(c <= 1) {
                if(f[G[i][0]]) {
                    r = G[i][0];
                } else {
                    r = G[i][1];
                }
            }
        }
    }
    if(r == -1) {
        cout << -1 << endl;
        return 0;
    }
    int v = r, pr = -1;
    while(1) {
        t.push_back(v);
        int nv = -1;
        for(auto& e : G[v]) {
            if(!f[e] && e != pr) {
                nv = e;
                break;
            }
        }
        if(nv == -1) {
            if(G[v][0] == pr) {
                t.push_back(G[v][1]);
            } else {
                t.push_back(G[v][0]);
            }
            break;
        }
        pr = v;
        v = nv;
    }
    for(auto& i : t) {
        f[i] = 0;
    }
    vector<int> p1, p2;
    int id = 1;
    for(auto& i : t) {
        int c = 0;
        for(auto& e : G[i]) {
            c += f[e];
        }
        for(int j = id + 1; j <= id + c; j++) {
            p1.push_back(j);
        }
        p1.push_back(id);
        id += c + 1;
    }
    reverse(all(t));
    id = 1;
    for(auto& i : t) {
        int c = 0;
        for(auto& e : G[i]) {
            c += f[e];
        }
        for(int j = id + 1; j <= id + c; j++) {
            p2.push_back(j);
        }
        p2.push_back(id);
        id += c + 1;
    }
    if(p1.size() != n) {
        cout << -1 << endl;
        return 0;
    }
    bool fl = true;
    for(int i = 0; i < n; i++) {
        if(p1[i] < p2[i]) {
            break;
        } else if(p1[i] > p2[i]) {
            fl = false;
            break;
        }
    }
    if(fl) {
        for(int i = 0; i < n; i++) {
            cout << p1[i] << " ";
        }
    } else {
        for(int i = 0; i < n; i++) {
            cout << p2[i] << " ";
        }
    }
    cout << endl;
}


Measured memory_bytes: 8056