/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author aajisaka
 */

#include<bits/stdc++.h>

using namespace std;

void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

#define SPEED ios_base::sync_with_stdio(false);cin.tie(nullptr)
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define all(v) v.begin(), v.end()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;

constexpr long double PI = 3.14159265358979323846264338327950288L;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

class FPermutationTree {
public:

    vector<int> graph[100005];

    void dfs(int v, int pa, vector<int>& dp) {
      for(auto e: graph[v]) {
        if (e == pa) continue;
        dp[e] = dp[v] + 1;
        dfs(e, v, dp);
      }
    }

    void dfs2(int v, int pa, vector<P>& dp) {
      for(auto e: graph[v]) {
        if (e == pa) continue;
        dp[e].first = dp[v].first + 1;
        dp[e].second = v;
        dfs2(e, v, dp);
      }
    }

    void dfs3(int v, int pa, vector<int>& ret, int now, vector<bool>& di) {
      int next = -1;
      int cnt = 0;
      for(auto e: graph[v]) {
        if (e == pa) continue;
        cnt++;
        if (di[e]) next = e;
      }
      if (cnt == 0) {
        ret.push_back(now);
        return;
      }
      for(int i=now+1; i<now+cnt; i++) {
        ret.push_back(i);
      }
      ret.push_back(now);
      dfs3(next, v, ret, now+cnt, di);
    }

    void solve(istream& cin, ostream& cout) {
      SPEED;
      int n; cin >> n;
      rep(i, n-1) {
        int u, v; cin >> u >> v;
        u--; v--;
        graph[u].push_back(v);
        graph[v].push_back(u);
      }

      vector<int> d0(n);
      dfs(0, -1, d0);
      int left = -1;
      int len = -1;
      rep(i, n) {
        if (chmax(len, d0[i])) {
          left = i;
        }
      }

      vector<P> d1(n);
      d1[left].second = -1;
      dfs2(left, -1, d1);
      int right = -1;
      ll llen = -1;
      rep(i, n) {
        if (chmax(llen, d1[i].first)) {
          right = i;
        }
      }
      debug(left, right);
      vector<bool> diameter(n);
      diameter[right] = true;
      int now = right;
      while(now != left) {
        now = d1[now].second;
        diameter[now] = true;
        debug(now);
      }

      vector<bool> reach(n);
      rep(i, n) {
        if (diameter[i]) {
          reach[i] = true;
          for(auto e: graph[i]) {
            reach[e] = true;
          }
        }
      }

      rep(i, n) {
        if (!reach[i]) {
          cout << -1 << endl;
          return;
        }
      }
      vector<int> ret1, ret2;
      dfs3(left, -1, ret1, 1, diameter);
      dfs3(right, -1, ret2, 1, diameter);

      bool printLeft = true;
      rep(i, n) {
        if (ret1[i] < ret2[i]) {
          break;
        } else if (ret2[i] < ret1[i]) {
          printLeft = false;
          break;
        }
      }

      if (printLeft) {
        for (auto e: ret1) {
          cout << e << ' ';
        }
      } else {
        for (auto e: ret2) {
          cout << e << ' ';
        }
      }
      cout << endl;

    }
};

signed main() {
  FPermutationTree solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}

Measured memory_bytes: 20952