#include <iostream>
#include <iomanip>
#include <string>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <vector>
#include <cassert>
#include <fstream>
#include <algorithm>
#include <list>
#include <random>
#include <ctime>
#include <cmath>
#include <random>
#include <bitset>
#include <complex>

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
//#define int ll
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector< vi > vvi;
typedef vector< vvi > vvvi;
typedef vector<short> vs;
typedef vector<vs> vvs;
typedef vector<vvs> vvvs;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef pair<ld, ld> pld;
typedef complex<double> base;

#define mmin(a, b) a = min(a, (b))
#define mmax(a, b) a = max(a, (b))
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define ALL(a) a.begin(),a.end()
#define sqr(x) (x) * (x)
#define fori(i, n) for(int i = 0; i < int(n); ++i)
#define cint const int &
#define SZ(a) ((int)(a.size()))
#define watch(x) cout << (#x) << " = " << x << endl;

const double PI = 2 * acos(0.0);

template<class T>
void show(const vector<T> &a) {
    for (T x : a)
        cout << x << " ";
    cout << endl;
}

const int N = 1e5 + 9;

struct edge {
    int u, v;
    bool is_long[2] = { 0, 0 }; // 0 : v->u; 1 : u->v
    bool is_good[2] = { 0, 0 };
    edge(int u, int v) : u(u), v(v) {

    }
    int getto(int v) {
        if (v == this->v) return this->u;
        return this->v;
    }
    bool check_v(int v) {
        return this->v == v;
    }
    bool check_u(int u) {
        return this->u == u;
    }
};

vector<edge> e;
vi g[N];
int n;

void dfs1(int v, int par_id) {
    int long_cnt = 0;
    if (par_id != -1)
        e[par_id].is_good[e[par_id].check_v(v)] = 1;
    for (int id : g[v]) if (id != par_id) {
            int to = e[id].getto(v);
            dfs1(to, id);
            if (par_id != -1) e[par_id].is_long[e[par_id].check_v(v)] = 1;
            long_cnt += e[id].is_long[e[id].check_u(v)];
            if (par_id != -1)
                e[par_id].is_good[e[par_id].check_v(v)] &= e[id].is_good[e[id].check_u(v)];
        }
    if (par_id != -1)
        e[par_id].is_good[e[par_id].check_v(v)] &= long_cnt < 2;
}

void dfs2(int v, int par_id) {
    int long_cnt = 0, child_cnt = 0, bad_cnt = 0;
    for (int id : g[v]) {
        bool c = e[id].check_u(v);
        long_cnt += e[id].is_long[c];
        ++child_cnt;
        bad_cnt += !e[id].is_good[c];
    }

    for (int id : g[v]) if (id != par_id) {
            bool c = e[id].check_u(v);
            long_cnt -= e[id].is_long[c];
            --child_cnt;
            bad_cnt -= !e[id].is_good[c];

            bool cc = e[id].check_v(v);
            e[id].is_long[cc] = child_cnt;
            e[id].is_good[cc] = !bad_cnt && long_cnt < 2;
            dfs2(e[id].getto(v), id);

            long_cnt += e[id].is_long[c];
            ++child_cnt;
            bad_cnt += !e[id].is_good[c];
        }
}

void dfs(int v, int par_id, int timer, vi &cur) {
    int long_ind = -1;
    fori (i, SZ(g[v])) {
        int id = g[v][i];
        if (id == par_id) continue;
        bool c = e[id].check_u(v);

        if (e[id].is_long[c]) {
            assert(long_ind == -1);
            long_ind = i;
            break;
        }
    }
    int old = timer++;
    vi lol;
    for (int i = 0; i < SZ(g[v]); ++i) if (g[v][i] != par_id && i != long_ind)
            lol.pb(timer++);

    if (long_ind == -1) {
        for (int i = 0; i < SZ(lol); ++i) {
            if (i == SZ(lol) - 1) {
                cur.pb(old);
            }
            cur.pb(lol[i]);
        }
    }
    else {
        for (int i = 0; i < SZ(lol); ++i)
            cur.pb(lol[i]);
        cur.pb(old);
        int id = g[v][long_ind];
        dfs(e[id].getto(v), id, timer, cur);
    }
}

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    cin >> n;
    fori(iter, n - 1) {
        int u, v;
        cin >> u >> v;
        g[u].pb(e.size());
        g[v].pb(e.size());
        e.pb(edge(u, v));
    }

    dfs1(1, -1);
    dfs2(1, -1);

    vi ans;
    set<int> used;
    for (int v = 1; v <= n; ++v) {
        int long_cnt = 0;
        bool good = 1;
        for (int id : g[v]) {
            good &= e[id].is_good[e[id].check_u(v)];
            long_cnt += e[id].is_long[e[id].check_u(v)];
        }
        good &= long_cnt < 2;
        good &= g[v].size() == 1;
        if (good) {
            //cout << v << " is good " << endl;
            int to = e[g[v][0]].getto(v);
            if (used.count(to)) continue;
            used.insert(to);
            vi cur;

            dfs(v, -1, 1, cur);

            if (ans.empty()) ans = cur;
            else if (ans > cur)	ans = cur;
        }
    }
    if (ans.empty()) cout << "-1";
    else show(ans);
}

Measured memory_bytes: 22836