#include <bits/stdc++.h>
#define GET_MACRO(_1,_2,_3,_4,_5,_6,NAME,...) NAME
#define pr(...) GET_MACRO(__VA_ARGS__,pr6,pr5,pr4,pr3,pr2,pr1)(__VA_ARGS__)
#define Pr(a) (#a)<<"="<<(a)<<" "
#define pr1(a) cerr<<Pr(a)<<endl;
#define pr2(a,b) cerr<<Pr(a)<<Pr(b)<<endl;
#define pr3(a,b,c) cerr<<Pr(a)<<Pr(b)<<Pr(c)<<endl;
#define pr4(a,b,c,d) cerr<<Pr(a)<<Pr(b)<<Pr(c)<<Pr(d)<<endl;
#define pr5(a,b,c,d,e) cerr<<Pr(a)<<Pr(b)<<Pr(c)<<Pr(d)<<Pr(e)<<endl;
#define pr6(a,b,c,d,e,f) cerr<<Pr(a)<<Pr(b)<<Pr(c)<<Pr(d)<<Pr(e)<<Pr(f)<<endl;
#define int long long
#define double long double
using namespace std;
const int N = 100010;
const int INF = 1LL<<55;
const int mod = (1e9)+7;
const double EPS = 1e-8;
const double PI = 6.0 * asin(0.5);
typedef pair<int,int> P;
typedef long long ll;
template<class T> T Max(T &a,T b){return a=max(a,b);}
template<class T> T Min(T &a,T b){return a=min(a,b);}
ostream& operator<<(ostream& o,P p){return o<<"("<<p.first<<","<<p.second<<")";}
istream& operator>>(istream& i,P &p){return i>>p.first>>p.second;}
ostream& operator<<(ostream& o,vector<auto> &a){int i=0;for(auto t:a)o<<(i++?" ":"")<<t;return o;}
istream& operator>>(istream& i,vector<auto> &a){for(auto &t:a)i>>t;return i;}
void prArr(auto a,string s=" "){int i=0;for(auto t:a)cout<<(i++?s:"")<<t;cout<<endl;}

class DiameterOfTree{
public:
  typedef pair<int,int> P;
  int V;
  vector<vector<P> > G;
  int start, end, length;
  DiameterOfTree():V(-1){}
  DiameterOfTree(int V):V(V),G(V){};
  void resize(int n){*this = DiameterOfTree(n);}
  
  void add_edge(int a,int b,int c = 1){
    assert(a < V && b < V);
    assert(a >= 0 && b >= 0);
    G[a].push_back(P(b,c));
    G[b].push_back(P(a,c));
  }
  
  P dfs(int pos,int pre = -1,int len = 0){
    if(pre == -1) start = pos, length = -1;
    if(len > length) length = len, end = pos;
    for(P p:G[pos]) if(p.first != pre) dfs(p.first, pos, len+p.second);
    return P(end,length);
  }

  //O(N);
  P get(){return dfs(dfs(0).first);}
};


class TreeSize{
public:
  int V;
  int root;
  vector<vector<int> > G;
  vector<int> w;
  vector<int> sz;
  int ok;
  TreeSize():V(-1){};
  TreeSize(int V,int root = 0):V(V),root(root),G(V),w(V,1),sz(V,0),ok(0){}
  void resize(int n){*this = TreeSize(n);}
  int& operator [](int i){return w[i];}
  
  void add_edge(int a,int b){
    ok = false;
    assert(a < V && b < V);
    assert(a >= 0 && b >= 0);
    G[a].push_back(b);
    G[b].push_back(a);
  }
  
  void build(int root=-1){
    ok = 1;
    if(root != -1) this->root = root;
    dfs(this->root,-1);
  }
  
  int dfs(int pos,int pre = -1){
    sz[pos] = w[pos];
    for(int to:G[pos]) if(to != pre) sz[pos] += dfs(to, pos);
    return sz[pos];
  }
  int size(int i){assert(ok);return sz[i];}
};

int n;
vector<vector<int> > G;
DiameterOfTree A;
TreeSize B;

vector<int> his;
int valid;
void dfs(int pos,int pre,int &cnt){
  
  sort(G[pos].begin(),G[pos].end(),[&](int a,int b){return B.size(a) < B.size(b);});
 
  int tmp = his.back();
  his.pop_back();
  for(int to:G[pos]) if(to != pre && B.size(to) == 1) his.push_back(cnt++);
  his.push_back(tmp);

  int v = 0;
  for(int to:G[pos]){
    if(to == pre || B.size(to) == 1) continue;
    v++;
    his.push_back(cnt++);
    dfs(to, pos, cnt);
  }
  if(v > 1) valid = 0;
}

vector<int> solve(int flag=0){
  if(flag == 0) A.get(), A.dfs(A.end);
  int start = flag == 0? A.start:A.end;

  B.build(start);
  his.clear();
  his.push_back(1);
  valid = 1;
  int cnt = 2;
  dfs(start,-1,cnt);
  
  int n = his.size();
  if(his.size()>=2 && his[n-1] < his[n-2]) swap(his[n-1],his[n-2]);
  if(!valid) return {};
  return his;
}

signed main(){
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  cin>>n;
  G.resize(n);
  A.resize(n);
  B.resize(n);
  for(int i=0;i<n-1;i++){
    int a,b;
    cin>>a>>b; a--,b--;
    G[a].push_back(b);
    G[b].push_back(a);
    A.add_edge(a,b);
    B.add_edge(a,b);
  }

  auto a = solve();
  auto b = solve(1);
  auto ans = min(a,b);
  if(ans.empty()) cout<<-1<<endl;
  else cout<<ans<<endl;
  
  return 0;
}


Measured memory_bytes: 33652