#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define mp make_pair
#define PI pair<int,int>
#define poly vector<int>
#define mem(a) memset((a),0,sizeof(a))
#define For(i,l,r) for(int i=(int)(l);i<=(int)(r);i++)
#define Rep(i,r,l) for(int i=(int)(r);i>=(int)(l);i--)
#define pb push_back
#define fi first
#define se second
inline char gc(){
    static char buf[100000],*p1=buf,*p2=buf;
    return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
#define gc getchar
inline ll read(){
	ll x = 0; char ch = gc(); bool positive = 1;
	for (; !isdigit(ch); ch = gc())	if (ch == '-')	positive = 0;
	for (; isdigit(ch); ch = gc())	x = x * 10 + ch - '0';
	return positive ? x : -x;
}
inline void write(ll a){
    if(a<0){
    	a=-a; putchar('-');
	}
    if(a>=10)write(a/10);
    putchar('0'+a%10);
}
inline void writeln(ll a){write(a); puts("");}
inline void wri(ll a){write(a); putchar(' ');}
inline ull rnd(){
	return ((ull)rand()<<30^rand())<<4|rand()%4;
}
const int N=100005;
int q[N],n,jb,rt,dep[N],fa[N],vis[N];
poly v[N];
void GG(){
	puts("-1"); exit(0);
}
poly solve(int *q,int m){
	int cnt=0;
	poly ans;
	For(i,1,m){
		int jj=++cnt;
		For(j,1,q[i])ans.pb(++cnt);
		ans.pb(jj);
	}
	if(cnt<n)GG(); return ans;
}
void dfs(int p){
	dep[p]=dep[fa[p]]+1; if(dep[p]>dep[rt])rt=p;
	for(auto i:v[p])if(i!=fa[p]){fa[i]=p; dfs(i);}
}
int main(){
	n=read();
	For(i,1,n-1){
		int s=read(),t=read();
		v[s].pb(t); v[t].pb(s);
	}
	dfs(1);
	fa[rt]=0; int zs=rt; rt=0; dfs(zs);
	for(int i=rt;i;i=fa[i])vis[i]=1;
	for(int i=rt;i;i=fa[i]){
		jb++;
		for(auto j:v[i])if(!vis[j])q[jb]++;
	}
	poly ans=solve(q,jb);
	reverse(q+1,q+jb+1);
	ans=min(ans,solve(q,jb));
	for(auto i:ans)wri(i);
}
### Prompt

Please create a solution in CPP to the following problem:

Takahashi has an ability to generate a tree using a permutation (p_1,p_2,...,p_n) of (1,2,...,n), in the following process:

First, prepare Vertex 1, Vertex 2, ..., Vertex N. For each i=1,2,...,n, perform the following operation:

* If p_i = 1, do nothing.
* If p_i \neq 1, let j' be the largest j such that p_j < p_i. Span an edge between Vertex i and Vertex j'.



Takahashi is trying to make his favorite tree with this ability. His favorite tree has n vertices from Vertex 1 through Vertex n, and its i-th edge connects Vertex v_i and w_i. Determine if he can make a tree isomorphic to his favorite tree by using a proper permutation. If he can do so, find the lexicographically smallest such permutation.

Constraints

* 2 \leq n \leq 10^5
* 1 \leq v_i, w_i \leq n
* The given graph is a tree.

Input

Input is given from Standard Input in the following format:


n
v_1 w_1
v_2 w_2
:
v_{n-1} w_{n-1}


Output

If there is no permutation that can generate a tree isomorphic to Takahashi's favorite tree, print `-1`. If it exists, print the lexicographically smallest such permutation, with spaces in between.

Examples

Input

6
1 2
1 3
1 4
1 5
5 6


Output

1 2 4 5 3 6


Input

6
1 2
2 3
3 4
1 5
5 6


Output

1 2 3 4 5 6


Input

15
1 2
1 3
2 4
2 5
3 6
3 7
4 8
4 9
5 10
5 11
6 12
6 13
7 14
7 15


Output

-1

### Response

```cpp
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define mp make_pair
#define PI pair<int,int>
#define poly vector<int>
#define mem(a) memset((a),0,sizeof(a))
#define For(i,l,r) for(int i=(int)(l);i<=(int)(r);i++)
#define Rep(i,r,l) for(int i=(int)(r);i>=(int)(l);i--)
#define pb push_back
#define fi first
#define se second
inline char gc(){
    static char buf[100000],*p1=buf,*p2=buf;
    return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
#define gc getchar
inline ll read(){
	ll x = 0; char ch = gc(); bool positive = 1;
	for (; !isdigit(ch); ch = gc())	if (ch == '-')	positive = 0;
	for (; isdigit(ch); ch = gc())	x = x * 10 + ch - '0';
	return positive ? x : -x;
}
inline void write(ll a){
    if(a<0){
    	a=-a; putchar('-');
	}
    if(a>=10)write(a/10);
    putchar('0'+a%10);
}
inline void writeln(ll a){write(a); puts("");}
inline void wri(ll a){write(a); putchar(' ');}
inline ull rnd(){
	return ((ull)rand()<<30^rand())<<4|rand()%4;
}
const int N=100005;
int q[N],n,jb,rt,dep[N],fa[N],vis[N];
poly v[N];
void GG(){
	puts("-1"); exit(0);
}
poly solve(int *q,int m){
	int cnt=0;
	poly ans;
	For(i,1,m){
		int jj=++cnt;
		For(j,1,q[i])ans.pb(++cnt);
		ans.pb(jj);
	}
	if(cnt<n)GG(); return ans;
}
void dfs(int p){
	dep[p]=dep[fa[p]]+1; if(dep[p]>dep[rt])rt=p;
	for(auto i:v[p])if(i!=fa[p]){fa[i]=p; dfs(i);}
}
int main(){
	n=read();
	For(i,1,n-1){
		int s=read(),t=read();
		v[s].pb(t); v[t].pb(s);
	}
	dfs(1);
	fa[rt]=0; int zs=rt; rt=0; dfs(zs);
	for(int i=rt;i;i=fa[i])vis[i]=1;
	for(int i=rt;i;i=fa[i]){
		jb++;
		for(auto j:v[i])if(!vis[j])q[jb]++;
	}
	poly ans=solve(q,jb);
	reverse(q+1,q+jb+1);
	ans=min(ans,solve(q,jb));
	for(auto i:ans)wri(i);
}
```