import std.stdio, std.algorithm, std.range, std.conv, std.string, std.math, std.typecons;
import core.stdc.stdio;
// foreach, foreach_reverse, writeln

alias Tuple!(int, int) Pair;

void main() {
	int n;
	scanf("%d", &n);
	int[][] graph = new int[][n];
	foreach (i; 0..n-1) {
		int v, w;
		scanf("%d%d", &v, &w);
		v--; w--;
		graph[v] ~= w;
		graph[w] ~= v;
	}
	Pair dfs(int v, int depth, int parent) {
		Pair ret = Pair(depth, v);
		foreach (u; graph[v]) {
			if (u == parent) continue;
			ret = max(ret, dfs(u, depth+1, v));
		}
		return ret;
	}
	int s = dfs(0,0,-1)[1];
	int t = dfs(s,0,-1)[1];

	int[] path;
	int[] used = new int[n];
	bool getpath(int v, int dist, int parent) {
		if (v == dist) {
			path ~= v;
			used[v] = true;
			return true;
		}
		foreach (u; graph[v]) {
			if (u == parent) continue;
			if (getpath(u, dist, v)) {
				path ~= v;
				used[v] = true;
				return true;
			}
		}
		return false;
	}
	getpath(s, t, -1);

	int[] generate() {
		int[] ret;
		foreach (v; path) {
			int cnt = 0;
			foreach (u; graph[v]) {
				if (used[u]) continue;
				cnt++;
			}
			int id = to!int(ret.length)+1;
			foreach (i; 0..cnt) {
				ret ~= id+1+i;
			}
			ret ~= id;
		}
		return ret;
	}
	int[] ans = generate();
	path.reverse();
	int[] ant = generate();
	if (ans.length < n) {
		writeln(-1);
	} else {
		ans = min(ans, ant);
		foreach (i; ans) writeln(i);
	}
}