output_description: For each k=1, 2, ..., N in this order, print a line containing the answer to
  the problem.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      a_1 b_1
      :
      a_{N-1} b_{N-1}
attempt: # 全方位木DP
  # トポロジカルソート→木DP→全方位
  from collections import deque
  import sys
  
  read = sys.stdin.buffer.read
  readline = sys.stdin.buffer.readline
  readlines = sys.stdin.buffer.readlines
  
  n = int(readline())
  
  # modの会場が必要なのでライブラリから
  mod = 10**9 + 7
  N = n + 5
  bikkuri = [0 for i in range(N)]
  bikkuri[0] = 1
  gyaku = [0 for i in range(N)]
  gyaku[0] = 1
  for i in range(1, N):
      bikkuri[i] = (i * bikkuri[i - 1]) % mod
      gyaku[i] = pow(bikkuri[i], mod - 2, mod)
  
  graph = [[] for _ in range(n + 1)]
  m = map(int, read().split())
  AB = zip(m, m)
  for a, b in AB:
      graph[a].append(b)
      graph[b].append(a)
  
  # topological sort
  par = [-1] * (n + 1)
  que = deque([])
  que.append(1)
  topo = []
  while que:
      v = que.popleft()
      topo.append(v)
      for u in graph[v]:
          if u == par[v]:
              continue
          par[u] = v
          graph[u].remove(v)
          que.append(u)
  
  # これでparのリストとtopological_sortと子供方向のみグラフを得る
  # 木DP
  dp1 = [0] * (n + 1)
  size = [0] * (n + 1)
  edge_index = [{} for _ in range(n + 1)]
  dpl = [[] for _ in range(n + 1)]
  dpr = [[] for _ in range(n + 1)]
  for v in topo[::-1]:
      dp1[v] = 1
      size[v] = 1
      # サイズを先に計算
      for u in graph[v]:
          size[v] += size[u]
          dp1[v] *= dp1[u]
          dp1[v] *= gyaku[size[u]]
      # 次に組み合わせを考える
      # 左から
      temp = 1
      for i in range(len(graph[v])):
          u = graph[v][i]
          edge_index[v][u] = i
          temp *= dp1[u]
          temp %= mod
          temp *= gyaku[size[u]]
          temp %= mod
          dpl[v].append(temp)
      # 右から
      temp = 1
      for i in range(len(graph[v]))[::-1]:
          u = graph[v][i]
          temp *= dp1[u]
          temp *= gyaku[size[u]]
          temp %= mod
          dpr[v].append(temp)
      dp1[v] *= bikkuri[size[v] - 1]
      dp1[v] %= mod
  
  # 全方位
  ans = [0] * (n + 1)
  dp2 = [0] * (n + 1)
  
  for v in topo:
      # 根の時
      if par[v] == -1:
          dp2[v] = 1
          ans[v] = dp1[v]
      else:
          # 上側の処理
          dp2[v] = 1
          p = par[v]
          # 上からみたv以外の累積積を取りたい。
          # graph[p]において、vは何番目かを考える。
          v_idx = edge_index[p][v]
          dp2[v] *= dp2[p] * gyaku[n - size[p]]
          dp2[v] *= bikkuri[n - size[v] - 1]
          dp2[v] %= mod
          # 左からv_idx個, idxはv_idx-1まで
          if dpl[p]:
              if v_idx - 1 >= 0:
                  dp2[v] *= dpl[p][v_idx - 1]
                  dp2[v] %= mod
              # 右からlen(grap[v])-(v_idx+1)個→idxはlen(graph[v])-v_idx-2
              if v_idx < len(graph[p]) - 1:
                  dp2[v] *= dpr[p][len(graph[p]) - 2 - v_idx]
                  dp2[v] %= mod
      # 上側と下側の合体
      ans[v] = bikkuri[n - 1]
      if dpl[v]:
          ans[v] *= dpl[v][-1]
      ans[v] *= dp2[v] * gyaku[n - size[v]]
      ans[v] %= mod
  
  print(*ans[1::], sep="/n")
  
problem_description: Statement
  
  We have a tree with N vertices numbered 1 to N. The i-th edge in this tree
  connects Vertex a_i and b_i. For each k=1, ..., N, solve the problem below:
  
    * Consider writing a number on each vertex in the tree in the following manner:
      * First, write 1 on Vertex k.
      * Then, for each of the numbers 2, ..., N in this order, write the number on the vertex chosen as follows:
        * Choose a vertex that still does not have a number written on it and is adjacent to a vertex with a number already written on it. If there are multiple such vertices, choose one of them at random.
    * Find the number of ways in which we can write the numbers on the vertices, modulo (10^9+7).
samples: [{"input": "3\n    1 2\n    1 3", "output": "2\n    1\n    1\n    \n\nThe graph in this input is as follows:\n\n![Figure](https://img.atcoder.jp/ghi/1c88b0eb716ba399b1c5d6565ab62337.png)\n\nFor k=1, there are two ways in which we can write the numbers on the vertices,\nas follows:\n\n  * Writing 1, 2, 3 on Vertex 1, 2, 3, respectively\n  * Writing 1, 3, 2 on Vertex 1, 2, 3, respectively\n\n* * *"}, {"input": "2\n    1 2", "output": "1\n    1\n    \n\nThe graph in this input is as follows:\n\n![Figure](https://img.atcoder.jp/ghi/c47c7798f88e7bfec30fbd664dc9ad50.png)\n\n* * *"}, {"input": "5\n    1 2\n    2 3\n    3 4\n    3 5", "output": "2\n    8\n    12\n    3\n    3\n    \n\nThe graph in this input is as follows:\n\n![Figure](https://img.atcoder.jp/ghi/e9c09403f8d96ae4e679a226993defa6.png)\n\n* * *"}, {"input": "8\n    1 2\n    2 3\n    3 4\n    3 5\n    3 6\n    6 7\n    6 8", "output": "40\n    280\n    840\n    120\n    120\n    504\n    72\n    72\n    \n\nThe graph in this input is as follows:\n\n![Figure](https://img.atcoder.jp/ghi/a85459a03d436560bfe2e911d8cec4e6.png)"}]