using System;
    using System.Linq;
    using System.Collections.Generic;
    public static class Program {
        public static void Main() {
            int n = int.Parse(Console.ReadLine());
            var graph = Enumerable.Range(0, n)
                .Select(_ => new List<int>())
                .ToArray();
            for (int i = 0; i < n - 1; i++) {
                var uv = Console.ReadLine().Split().Select(int.Parse).ToArray();
                int u = uv[0];
                int v = uv[1];
                u--;
                v--;
                graph[u].Add(v);
                graph[v].Add(u);
            }
            for (int u = 0; u < n; u++) {
                // Console.Write($"{u}:");
                foreach (int v in graph[u]) {
                    // Console.Write($" {v}");
                }
                // Console.Write("\n");
            }

            Func<int, int> far = (int start) => {
                var dist = new int[n];
                Action<int, int> dfs = null;
                dfs = (int x, int p) => {
                    foreach (int y in graph[x]) {
                        if (y == p) continue;
                        dist[y] = dist[x] + 1;
                        dfs(y, x);
                    }
                };
                dfs(start, start);
                int goal = start;
                for (int i = 0; i < n; i++) {
                    if (dist[goal] < dist[i]) {
                        goal = i;
                    }
                }
                return goal;
            };

            int s = far(0);
            int t = far(s);
            // Console.WriteLine($"farthest: {s}, {t}");


            var deg = new List<int>();
            {
                Func<int, int, bool> Dfs = null;
                Dfs = (int x, int p) => {
                    if (x == t) {
                        deg.Add(graph[t].Count);
                        return true;
                    }
                    foreach (int y in graph[x]) {
                        if (y == p) continue;
                        if (Dfs(y, x)) {
                            deg.Add(graph[x].Count - (x == s ? 0 : 1));
                            return true;
                        }
                    }
                    return false;
                };
                Dfs(s, s);
            }
            var deg_rev = deg.AsEnumerable().Reverse().ToList();
            // Console.Write("deg:");
            foreach (int x in deg) {
                // Console.Write($" {x}");
            }
            // Console.Write('\n');
            // Console.Write("deg_rev:");
            foreach (int x in deg_rev) {
                // Console.Write($" {x}");
            }
            // Console.Write('\n');

            // check if catapiller
            if (deg.Sum() != n) {
                Console.WriteLine(-1);
                Environment.Exit(0);
            }

            var perm0 = MakePermutation(deg, n);
            // Console.Write("perm0:");
            foreach (int x in perm0) {
                // Console.Write($" {x}");
            }
            // Console.Write('\n');

            var perm1 = MakePermutation(deg_rev, n);
            // Console.Write("perm1:");
            foreach (int x in perm1) {
                // Console.Write($" {x}");
            }
            // Console.Write('\n');

            var ans = new List<int>();
            for (int i = 0; i < n; i++) {
                if (perm0[i] < perm1[i]) {
                    ans = perm0;
                    break;
                } else if (perm0[i] > perm1[i]) {
                    ans = perm1;
                    break;
                }
            }
            if (ans.Count == 0) {
                ans = perm0;
            }
            for (int i = 0; i < n; i++) {
                if (0 < i) Console.Write(' ');
                Console.Write(ans[i] + 1);
            }
            Console.Write('\n');
        }

        public static List<int> MakePermutation(List<int> a, int n) {
            var ans = Enumerable.Range(0, n).ToList();
            for (int i = 1; i < a.Count; i++) {
                a[i] += a[i-1];
            }
            Action<int,int> Rotate = (int l, int r) => {
                // Console.WriteLine($"rotate {l} {r}");
                for (int i = l; i < r - 1; i++) {
                    // Console.WriteLine($" -- swap {i} {i+1}");
                    ans[i + 1] ^= ans[i];
                    ans[i] ^= ans[i + 1];
                    ans[i + 1] ^= ans[i];
                }
            };
            for (int i = 1; i < a.Count; i++) {
                Rotate(a[i - 1], a[i]);
            }
            return ans;
        }
    }


Measured memory_bytes: 47616