#include<algorithm>
#include<cmath>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<unordered_map>
#include<unordered_set>
#include<vector>
using ll = long long;
enum : int { M = (int)1e9 + 7 };
enum : ll { MLL = (ll)1e18L + 9 };
using namespace std;
#ifdef LOCAL
#include"rprint2.hpp"
#include"debug_deque.hpp"
#define vector DebugDeque
#else
#define FUNC(name) template <ostream& out = cout, class... T> void name(T&&...){ }
FUNC(prints) FUNC(printe) FUNC(printw) FUNC(printew) FUNC(printb) FUNC(printd) FUNC(printde);
#endif
template <class S, class T>
istream& operator >> (istream& in, pair<S, T>& p){ in >> p.first >> p.second; return in; }
template <class T>
istream& operator >> (istream& in, vector<T>& v){ for(auto& e : v){ in >> e; } return in; }
template <char d = ' ', class T>
ostream& operator << (ostream& out, vector<T>& v){ for(auto& e : v){ out << e << d; } return out; }

struct Graph{
    struct Node{
        vector<int> dests;
    };
    vector<Node> nodes;
    Graph(int num): nodes(num){ }
    int id(Node* n){ return n - &nodes[0]; }
    int id(Node& n){ return &n - &nodes[0]; }
    void print(){ for(auto& node : nodes){ prints(id(node), node.dests); } }
    void addEdge(int from, int dest){
        nodes[from].dests.push_back(dest);
    }
    void addEdge2(int from, int dest){
        addEdge(from, dest);
        addEdge(dest, from);
    }
    void dfs(vector<int>& ans, int idx, int num = 1, int from = -1){
        int next = -1, cnt = 1;
        vector<int> legs;
        for(int didx : nodes[idx].dests){
            if(didx == from){ continue; }
            if(nodes[didx].dests.size() == 1){
                legs.push_back(num + cnt++);
            }else if(nodes[didx].dests.size() > 1){
                if(next != -1){
                    cout << -1 << '\n';
                    exit(0);
                }
                next = didx;
            }
        }
        ans.insert(ans.end(), legs.begin(), legs.end());
        ans.push_back(num);
        if(next != -1){
            dfs(ans, next, num + cnt, idx);
        }
    }
    pair<int, int> farthest(int idx, int acc = 0, int from = -1){
        prints(idx);
        pair<int, int> ret(acc, idx);
        for(int didx : nodes[idx].dests){
            if(didx == from){ continue; }
            auto r = farthest(didx, acc + 1, idx);
            ret = max(ret, r);
        }
        return ret;
    }
    pair<int, int> diameter(){
        pair<int, int> ret;
        auto p = farthest(0);
        ret.first = p.second;
        p = farthest(p.second);
        ret.second = p.second;
        return ret;
    }
};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    Graph g(n);
    for(int i = 0; i < n - 1; i++){
        int v, w;
        cin >> v >> w;
        v--; w--;
        g.addEdge2(v, w);
    }
    auto p = g.diameter();
    vector<int> a1, a2;
    g.dfs(a1, p.first);
    g.dfs(a2, p.second);
    prints(a1, a2);
    if(a1[n - 2] > a1[n - 1]){ swap(a1[n - 2], a1[n - 1]); }
    if(a2[n - 2] > a2[n - 1]){ swap(a2[n - 2], a2[n - 1]); }
    for(int i = 0; i < n; i++){
        if(a1[i] != a2[i]){
            cout << (a1[i] < a2[i] ? a1 : a2) << '\n';
            return 0;
        }
    }
    cout << a1 << '\n';
}


Measured memory_bytes: 13432