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: import sys
  
  sys.setrecursionlimit(10**9)
  input = sys.stdin.readline
  from collections import deque
  
  MOD = 10**9 + 7
  N = int(input())
  tree = dict(zip(range(N), [[] for i in range(N)]))
  edge_id = {}
  c = 0
  for i in range(N - 1):
      a, b = map(int, input().split())
      a, b = a - 1, b - 1
      tree[a].append(b)
      tree[b].append(a)
      edge_id[(a, b)] = c
      edge_id[(b, a)] = c + 1
      c += 2
  
  # 部分木のサイズ
  # 頂点v1 -> v2の向きを考えたときに、頂点v2を根とする部分木のサイズを計算する
  size = [0] * 2 * (N - 1)
  
  
  def calc_size(v1, v2):
      global size
      idx = edge_id[(v1, v2)]
      if size[idx]:
          return size[idx]
      children = tree[v2]
      s = 1
      for child in children:
          if child == v1:
              continue
          s += calc_size(v2, child)
      size[idx] = s
      idx_inv = edge_id[(v2, v1)]
      size[idx_inv] = N - s
      return s
  
  
  # 階乗、組合せの計算
  g1 = [1, 1]
  g2 = [1, 1]
  inverse = [0, 1]
  MOD = 10**9 + 7
  for i in range(2, 10**5 + 1):
      g1.append((g1[-1] * i) % MOD)
      inverse.append((-inverse[MOD % i] * (MOD // i)) % MOD)
      g2.append((g2[-1] * inverse[-1]) % MOD)
  
  
  def comb(n, r, mod=MOD):
      if r < 0 or r > n:
          return 0
      r = min(r, n - r)
      return g1[n] * g2[r] * g2[n - r] % mod
  
  
  # 頂点iに1を書くときの場合の数
  ans = [0] * N
  dp = [0] * 2 * (N - 1)
  
  
  def calc_dp(v1, v2):
      global dp
      idx = edge_id[(v1, v2)]
      if dp[idx]:
          return dp[idx]
      children = tree[v2]
      s = calc_size(v1, v2)
      res = g1[s - 1]
      for child in children:
          if child == v1:
              continue
          res *= calc_dp(v2, child)
          res %= MOD
          _s = calc_size(v2, child)
          res *= g2[_s]
          res %= MOD
      dp[idx] = res
      return res
  
  
  def calc_ans(i):
      global ans
      global dp
      if ans[i]:
          return ans[i]
      children = tree[i]
      res = g1[N - 1]
      for child in children:
          res *= calc_dp(i, child)
          res %= MOD
          _s = calc_size(i, child)
          res *= g2[_s]
          res %= MOD
      ans[i] = res
      return res
  
  
  calc_ans(0)
  d = deque([[0, -1]])
  c = 0
  while d:
      node, par = d.popleft()
      c += 1
      children = tree[node]
      for child in children:
          if child == par:
              continue
          s = calc_size(node, child)
          r = s * pow(N - s, MOD - 2, MOD) % MOD
          ans[child] = ans[node] * r % MOD
          d.append([child, node])
  
  print(*ans, 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)"}]