import Control.Monad
import Data.List
import qualified Data.IntSet as Set
import qualified Data.IntMap as Map
import Debug.Trace

main = do
  n <- readLn
  es <- replicateM (n-1) $ fmap ((\[x,y]->(x,y)) . map read . words) getLine
  case solve es of
    Nothing -> print (-1)
    Just as -> putStrLn (unwords (map show as))

type BoneSet = Set.IntSet
type BoneMap = Map.IntMap [Int]

solve :: [(Int,Int)] -> Maybe [Int]
solve es =
  toPermRep (head ends) bones (restruct bones es)
  where
    (vs,ws) = unzip es

    bones :: Set.IntSet
    bones = Set.fromList . map head . filter ((>1).length) . group . sort $ vs++ws

    ends :: [Int]
    ends = map head . filter((==1).length) . group . sort . concat $ [[v,w]| (v,w)<-es, v`Set.member`bones, w`Set.member`bones]

restruct :: BoneSet -> [(Int,Int)] -> BoneMap
restruct bones es =
  go es Map.empty
  where
    go :: [(Int,Int)] -> Map.IntMap [Int] -> Map.IntMap [Int]
    go []         m = m
    go ((v,w):ds) m = case (v`Set.member`bones, w`Set.member`bones) of
                        (True, False) -> go ds (Map.alter (f w) v m)
                        (False, True) -> go ds (Map.alter (f w) v m)
                        _             -> go ds (Map.alter (f v) w (Map.alter (f w) v m))

    f :: Int -> Maybe [Int] -> Maybe [Int]
    f w Nothing   = Just [w]
    f w (Just ws) = Just (w:ws)

toPermRep :: Int -> BoneSet -> BoneMap -> Maybe [Int]
toPermRep end bones m =
  --traceShow m $ traceShow bones $ traceShow end $
  go end end 1 m [] []
  where
    go cur prev idx m hd tl =
      case Map.lookup cur m of
        Just ws -> let (bs,cs) = partition (`Set.member`bones) ws
                       step = length cs
                   in case filter (/=prev) bs of
                        [b] -> go b cur (idx+step+1) (Map.delete cur m) ([idx+1..idx+step]++hd) (idx:tl)
                        _   -> if Map.null (Map.delete cur m)
                                 then Just ([idx+1..idx+step] ++ hd ++ reverse (idx:tl))
                                 else Nothing
        _       -> Nothing