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


main = do
  n <- readLn
  input <- B.getContents
  let es = map ((\[x,y]->x`seq`y`seq`(x,y)) . map readI . B.words) $ take (n-1) $ B.lines $ input
  case solve es of
    Nothing -> print (-1)
    Just as -> putStrLn (unwords (map show as))

-- for fast read
readI :: B.ByteString -> Int
readI s = case B.readInt s of Just (n,_) -> n


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

solve :: [(Int,Int)] -> Maybe [Int]
solve es =
  fmap toAnswer $ toBoneList (head ends) (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 =
  foldl' f Map.empty es
  where
    f :: Map.IntMap [Int] -> (Int,Int) -> Map.IntMap [Int]
    f m (v,w) = case (v`Set.member`bones, w`Set.member`bones) of
                  (True, False) -> Map.alter (updatem w) v m
                  (False, True) -> Map.alter (updatem v) w m
                  _             -> Map.alter (updatem v) w (Map.alter (updatem w) v m)

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


toBoneList :: Int -> BoneMap -> Maybe [Int]
toBoneList end m =
  go end 0 m [] True
  where
    go cur prev m acc first =
      case Map.lookup cur m of
        Just ws -> let (bs,cs) = partition (`Map.member`m) ws
                       k = length (filter (/=prev) cs)
                   in case filter (/=prev) bs of
                        [next]              -> go next cur (Map.delete cur m) (if first && k >0 then k-1:0:acc else 0:acc) False
                        _ | Map.size m == 1 -> Just (if k > 0 then 0:k-1:acc else 0:acc)
                          | otherwise       -> Nothing
        Nothing-> Nothing

toAnswer :: [Int] -> [Int]
toAnswer xs =
  reverse . snd .foldl' f (1,[]) $ min xs (reverse xs)
  where
    f (p, ps) x = (p+x+1, p:[p+x,p+x-1..p+1]++ps)