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).

Constraints

* 2 \leq N \leq 2 \times 10^5
* 1 \leq a_i,b_i \leq N
* The given graph is a tree.

Input

Input is given from Standard Input in the following format:


N
a_1 b_1
:
a_{N-1} b_{N-1}


Output

For each k=1, 2, ..., N in this order, print a line containing the answer to the problem.

Examples

Input

3
1 2
1 3


Output

2
1
1


Input

2
1 2


Output

1
1


Input

5
1 2
2 3
3 4
3 5


Output

2
8
12
3
3


Input

8
1 2
2 3
3 4
3 5
3 6
6 7
6 8


Output

40
280
840
120
120
504
72
72
# 全方位木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

for i in range(1, n + 1):
    print(ans[i])
