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: from itertools import accumulate, chain
  from sys import setrecursionlimit
  
  setrecursionlimit(10000000)
  
  MOD = 10**9 + 7
  
  
  # 拡張ユークリッド互除法
  # ax + by = gcd(a,b)の最小整数解を返す
  def egcd(a, b):
      if a == 0:
          return (b, 0, 1)
      else:
          g, y, x = egcd(b % a, a)
          return (g, x - (b // a) * y, y)
  
  
  # mを法とするaの乗法的逆元
  def modinv(a, m):
      g, x, y = egcd(a, m)
      if g != 1:
          raise Exception("modular inverse does not exist")
      else:
          return x % m
  
  
  N = int(input())
  adj = [list() for _ in range(N)]
  edges = []
  for _ in range(N - 1):
      a, b = map(int, input().split())
      adj[a - 1].append(b - 1)
      adj[b - 1].append(a - 1)
      edges.append((a - 1, b - 1))
  
  factorio = tuple(chain((1,), accumulate(range(1, N + 1), lambda x, y: (x * y) % MOD)))
  
  patterns = dict()
  childrens = dict()
  
  
  def rec(a, b):
      if (a, b) in patterns:
          return patterns[(a, b)], childrens[(a, b)]
      if a != -1 and len(adj[b]) == 1:
          patterns[(a, b)] = 1
          childrens[(a, b)] = 1
          return 1, 1
  
      prod = 1  # product of patterns
      d = 1  # denominator of multinomial coefficient
      n = 0  # total childrens
      for c in adj[b]:
          if a == c:
              continue
          p, c = rec(b, c)
          prod *= p
          prod %= MOD
          d *= factorio[c]
          d %= MOD
          n += c
  
      patterns[(a, b)] = (prod * factorio[n] * modinv(d, MOD)) % MOD
      childrens[(a, b)] = n + 1
      return patterns[(a, b)], childrens[(a, b)]
  
  
  for a, b in edges:
      rec(a, b)
      rec(b, a)
  
  for k in range(N):
      p, c = rec(-1, k)
      print(p)
  
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)"}]