Connected undirected graph without cycles is called a tree. Trees is a class of graphs which is interesting not only for people, but for ants too.

An ant stands at the root of some tree. He sees that there are *n* vertexes in the tree, and they are connected by *n* - 1 edges so that there is a path between any pair of vertexes. A leaf is a distinct from root vertex, which is connected with exactly one other vertex.

The ant wants to visit every vertex in the tree and return to the root, passing every edge twice. In addition, he wants to visit the leaves in a specific order. You are to find some possible route of the ant.
The first line contains integer *n* (3 ≤ *n* ≤ 300) — amount of vertexes in the tree. Next *n* - 1 lines describe edges. Each edge is described with two integers — indexes of vertexes which it connects. Each edge can be passed in any direction. Vertexes are numbered starting from 1. The root of the tree has number 1. The last line contains *k* integers, where *k* is amount of leaves in the tree. These numbers describe the order in which the leaves should be visited. It is guaranteed that each leaf appears in this order exactly once.
class Operation:
    def __init__(self, name, function, function_on_equal, neutral_value=0):
        self.name = name
        self.f = function
        self.f_on_equal = function_on_equal


def add_multiple(x, count):
    return x * count


def min_multiple(x, count):
    return x


def max_multiple(x, count):
    return x


sum_operation = Operation("sum", sum, add_multiple, 0)
min_operation = Operation("min", min, min_multiple, 1e9)
max_operation = Operation("max", max, max_multiple, -1e9)



class SegmentTree:
    """
    SegmentTree class. Handles an underlying array as well as available
    operations and pointer to the root of a tree.
    """

    def __init__(self,
                 array,
                 operations=[sum_operation, min_operation, max_operation]):
        """
        Builds a segment tree based on the provided `array`. Supports operations
        of class Operation provided in the operations array.
        """
        self.array = array
        if type(operations) != list:
            raise TypeError("operations must be a list")
        self.operations = {}
        for op in operations:
            self.operations[op.name] = op
        self.root = SegmentTreeNode(0, len(array) - 1, self)

    def query(self, start, end, operation_name):
        """
        Returns the result of the operation execution with `operation_name`
        on the range from [start, end]
        """
        if self.operations.get(operation_name) == None:
            raise Exception("This operation is not available")
        return self.root._query(start, end, self.operations[operation_name])

    def summary(self):
        """
        Prints the summary for the whole array (values in the root node).
        """
        return self.root.values

    def update(self, position, value):
        """
        Updates an old value at `position` to a new `value`.
        """
        self.root._update(position, value)

    def update_range(self, start, end, value):
        """
        Updates old values old in the range [start, end], inclusively, to a new value.
        """
        self.root._update_range(start, end, value)

    def __repr__(self):
        return self.root.__repr__()


class SegmentTreeNode:
    """
    Internal SegmentTreeNode class represents a node of a segment tree. Each node
    stores the reference to the left and the right bound of a segment this
    node is responsible for.
    """

    def __init__(self, start, end, segment_tree):
        self.range = (start, end)
        self.parent_tree = segment_tree
        self.range_value = None
        self.values = {}
        self.left = None
        self.right = None
        if start == end:
            self._sync()
            return
        self.left = SegmentTreeNode(start, start + (end - start) // 2,
                                    segment_tree)
        self.right = SegmentTreeNode(start + (end - start) // 2 + 1, end,
                                     segment_tree)
        self._sync()

    def _query(self, start, end, operation):
        if end < self.range[0] or start > self.range[1]:
            return None
        if start <= self.range[0] and self.range[1] <= end:
            return self.values[operation.name]
        self._push()
        left_res = self.left._query(start, end,
                                    operation) if self.left else None
        right_res = self.right._query(start, end,
                                      operation) if self.right else None
        if left_res is None:
            return right_res
        if right_res is None:
            return left_res
        return operation.f([left_res, right_res])

    def _update(self, position, value):
        if position < self.range[0] or position > self.range[1]:
            return
        if position == self.range[0] and self.range[1] == position:
            self.parent_tree.array[position] = value
            self._sync()
            return
        self._push()
        self.left._update(position, value)
        self.right._update(position, value)
        self._sync()

    def _update_range(self, start, end, value):
        if end < self.range[0] or start > self.range[1]:
            return
        if start <= self.range[0] and self.range[1] <= end:
            self.range_value = value
            self._sync()
            return
        self._push()
        self.left._update_range(start, end, value)
        self.right._update_range(start, end, value)
        self._sync()

    def _sync(self):
        if self.range[0] == self.range[1]:
            for op in self.parent_tree.operations.values():
                current_value = self.parent_tree.array[self.range[0]]
                if self.range_value is not None:
                    current_value = self.range_value
                self.values[op.name] = op.f([current_value])
        else:
            for op in self.parent_tree.operations.values():
                result = op.f(
                    [self.left.values[op.name], self.right.values[op.name]])
                if self.range_value is not None:
                    bound_length = self.range[1] - self.range[0] + 1
                    result = op.f_on_equal(self.range_value, bound_length)
                self.values[op.name] = result

    def _push(self):
        if self.range_value is None:
            return
        if self.left:
            self.left.range_value = self.range_value
            self.right.range_value = self.range_value
            self.left._sync()
            self.right._sync()
            self.range_value = None

    def __repr__(self):
        ans = "({}, {}): {}\n".format(self.range[0], self.range[1],
                                      self.values)
        if self.left:
            ans += self.left.__repr__()
        if self.right:
            ans += self.right.__repr__()
        return ans


n = int(input())
adj = [[] for i in range(n)]
for i in range(n-1):
    u,v = map(int,input().split())
    adj[u-1].append(v-1)
    adj[v-1].append(u-1)

leaf_order = [int(x)-1 for x in input().split()]
k = len(leaf_order)

if k==1:
    visited = [0]*n
    tour=[]
    height=[-1 for i in range(n)]
    height[0]=1
    parent=[-1 for i in range(n)]
    #parent[0]=-1
    def euler_tour(adj,u):
        visited[u] = 1
        tour.append(u)
        for v in adj[u]:
            if not visited[v]:
                parent[v]=u
                height[v]=height[u]+1
                #print(height)
                euler_tour(adj,v)
                tour.append(u)
        return tour
    euler_tour(adj,0)
    cur=leaf_order[0]
    final_path=[cur]
    while(cur!=0):
      cur=parent[cur]
      final_path+=[cur]
    final_path.reverse()
    
      
    cur=leaf_order[0]
    
    while(cur!=0):
      cur=parent[cur]
      final_path+=[cur]
    
    
    for i in range(len(final_path)):
      final_path[i]+=1
    
    for i in range(len(final_path)):
      print(final_path[i],end=" ")
    

else:
  
  
  visited = [0]*n
  tour=[]
  height=[-1 for i in range(n)]
  height[0]=1
  parent=[-1 for i in range(n)]
  #parent[0]=-1
  def euler_tour(adj,u):
      visited[u] = 1
      tour.append(u)
      for v in adj[u]:
          if not visited[v]:
              parent[v]=u
              height[v]=height[u]+1
              #print(height)
              euler_tour(adj,v)
              tour.append(u)
      return tour
  
  def add_path(l,m,r):
    #print(l,m,r)
    h_l = height[l]
    h_m=m
    h_r=height[r]
    path1=[l]
    while(height[l]!=m):
      #print(l,m)
      l = parent[l]
      path1+=[l]
    path2=[r]
    while(height[r]!=m):
      r = parent[r]
      path2+=[r]
    path2.pop()
    path2.reverse()
    path=path1+path2
    #print(path)
    return  path
    
    
    
  
  euler_tour(adj,0)
  
  first=[-1 for i in range(n)]
  
  for i in range (len(tour)):
    if first[tour[i]]==-1:
      first[tour[i]]=i
  
  height_arr=[height[i] for i in tour]
  
  #print(tour)
  #print(first)
  #print(height)
  #print(height_arr)
  
  left_index=6
  right_index=7
  
  st = SegmentTree(height_arr)
  #print(st)
  #print(st.get_minimum(head=root, left=left_index, right=right_index))
  path=[]
  red_flag=0
  for i in range(k-1):
    left_index=first[leaf_order[i]]
    right_index=first[leaf_order[i+1]]
    if left_index<right_index:
    
      lca = st.query(left_index, right_index,"min")
      
      path+=[add_path(leaf_order[i],lca,leaf_order[i+1])]
      #print(path)
    else:
      red_flag=1
  
  if red_flag==0:
    for i in range(len(path)-1):
      path[i].pop()
    
    cur=leaf_order[0]
    final_path=[cur]
    while(cur!=0):
      cur=parent[cur]
      final_path+=[cur]
    final_path.reverse()
    final_path.pop()
    
    for i in range(len(path)):
      final_path+=path[i]
    #print(final_path)
    
    cur=leaf_order[-1]
    
    while(cur!=0):
      cur=parent[cur]
      final_path+=[cur]
    
    def valid(p):
        for i in range(len(p)-1):
            start = p[i]
            end = p[i+1]
            for j in range(i+1,len(p)-1):
                if p[j] == start and p[j+1] == end:
                    return False
        
        return True
    
    if valid(final_path):
      for i in range(len(final_path)):
        final_path[i]+=1
      for i in range(len(final_path)):
        print(final_path[i],end=" ")
    else:
      print(-1)
  else:
    print(-1)
  
    
  #print(add_path(5,0,2))