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
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;
import java.util.TreeSet;

import javax.swing.*;


import static java.util.Arrays.binarySearch;
import static java.util.Arrays.copyOfRange;

public class Main {

    public static void main(String[] args) throws Exception {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;

        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);

        Task solver = new Task();
        solver.solve(1, in, out);
        out.close();
    }
}

class Task {

    private static int mod = 1000000007;

    int n;
    int[] cnt;
    long[] ans;
    long[] fac;
    long[] tmp;
    Vectex[] vec;

    public long powMod(long a, long b) {
        long ans = 1, d = a % mod;
        while (b > 0) {
            if (b % 2 == 1) {
                ans = ans * d % mod;
            }
            b >>= 1;
            d = d * d % mod;
        }
        return ans;
    }

    public long getC(int n, int m) {
        //System.out.println(n + " " + m);
        return fac[n] * powMod(fac[m], mod - 2) % mod * powMod(fac[n - m], mod - 2) % mod;
    }

    public void solve(int testNumber, InputReader in, PrintWriter out) {
        n = in.nextInt();
        vec = new Vectex[n];
        cnt = new int[n];
        ans = new long[n];
        tmp = new long[n];
        fac = new long[n + 1];
        for (int i = 0; i < n; i++) {
            vec[i] = new Vectex();
        }
        for (int i = 0; i < n - 1; i++) {
            int x = in.nextInt();
            int y = in.nextInt();
            x--; y--;
            vec[x].adj.add(y);
            vec[y].adj.add(x);
        }
        fac[0] = 1L;
        for (int i = 1; i <= n; i++) {
            fac[i] = fac[i - 1] * i % mod;
        }
        dfs(0, -1);
        //for (int i = 0; i < n; i++) {
        //    out.println(tmp[i]);
        //}
        dfs2(0, -1);
        for (int i = 0; i < n; i++) {
            out.println(ans[i]);
        }
    }

    private void dfs2(int u, int fu) {
        if (fu != -1) {
            long t = ans[fu] * powMod(getC(n - 1, cnt[u]), mod - 2) % mod;
            ans[u] = getC(n - 1, n - cnt[u]) * t % mod;
        } else {
            ans[u] = tmp[u];
        }
        for (int v : vec[u].adj) {
            if (v != fu) {
                dfs2(v, u);
            }
        }
    }

    private void dfs(int u, int fu) {
        cnt[u] = 1;
        tmp[u] = 1;
        for (int v : vec[u].adj) {
            if (v != fu) {
                dfs(v, u);
                cnt[u] += cnt[v];
            }
        }
        int nn = cnt[u] - 1;
        for (int v : vec[u].adj) {
            if (v != fu) {
                tmp[u] = tmp[u] * getC(nn, cnt[v]) % mod * tmp[v] % mod;
                nn -= cnt[v];
            }
        }

    }

    class Vectex {
        List<Integer> adj;

        public Vectex() {
            this.adj = new ArrayList<>();
        }
    }

}



class InputReader {

    private final BufferedReader reader;
    private StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String nextLine() {
        try {
            return reader.readLine();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(nextLine());
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }

}
