#include<bits/stdc++.h>
using namespace std;

#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define repn(i, n) for(int (i) = 1; (i) <= (n); (i)++)
#define repr(i, n) for(int (i) = (n-1); (i) >= 0; (i)--)
#define all(x) (x).begin(), (x).end()
#define lint long long
#define ulint unsigned long long
#define fi first
#define se second
#define setpre(x) cout << fixed << setprecision(x)
#define ii(x) int x; cin >> (x)
#define ii2(x, y) int x, y; cin >> (x) >> (y)
#define ii3(x, y, z) int x, y, z; cin >> (x) >> (y) >> (z)
#define out(x) cout << (x) << endl
#define outs(x) cout << (x) << " "
#define yn(x) cout << ((x)?("Yes"):("No")) << endl
#define YN(x) cout << ((x)?("YES"):("NO")) << endl
#define bit_c(x) __builtin_popcountll(x)

inline void logger(){ cout << " [LOGGER] " << endl; }
template<typename A, typename... B>
void logger(const A& a, const B&... b){
    cout << a << " , ";
    logger(b...);
}

typedef pair<lint, lint> P;
const lint MOD = 1000000007;
const lint MOD9 = 998244353;
const lint INF = MOD * MOD;
const int MAX = 200005;

/* ...o(^-^)o... */

vector<int> to[MAX];

const lint mod = MOD;
class mint{
    public:
        long long x;

    constexpr mint(long long _x = 0) : x((_x%mod+mod)%mod) {}
    constexpr mint operator-() const{
        return mint(-x);
    }
    constexpr mint& operator+=(const mint& a){
        if((x += a.x) >= mod) x -= mod;
        return *this;
    }
    constexpr mint& operator-=(const mint& a){
        if((x += mod-a.x) >= mod) x -= mod;
        return *this;
    }
    constexpr mint& operator*=(const mint& a){
        (x *= a.x) %= mod;
        return *this;
    }
    constexpr mint operator+(const mint& a) const{
        mint res(*this);
        return res+=a;
    }
    constexpr mint operator-(const mint& a) const{
        mint res(*this);
        return res-=a;
    }
    constexpr mint operator*(const mint& a) const{
        mint res(*this);
        return res*=a;
    }
    mint pow(long long x) const{
        if(!x) return 1;
        mint a = pow(x>>1);
        a *= a;
        if(x&1) a *= *this;
        return a; 
    }
    mint inv() const{
        return pow(mod-2);
    }
    mint& operator/=(const mint& a){
        return (*this) *= a.inv();
    }
    mint operator/(const mint& a) const{
        mint res(*this);
        return res/=a;
    }
    friend ostream& operator<<(ostream& os, const mint& m){
        os << m.x; return os;
    }
};

mint fac[MAX], facinv[MAX], inv[MAX];
void minit(){
    fac[0] = fac[1] = 1;
    facinv[0] = facinv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i;
        inv[i] = -mint(mod / i)*inv[mod % i];
        facinv[i] = facinv[i - 1] * inv[i];
    }   
}
mint mcomb(mint a, mint b){
    if (a.x < b.x) return 0;
    if (a.x < 0 || b.x < 0) return 0;
    return fac[a.x] * facinv[b.x] * facinv[a.x - b.x];
}

struct DP{
    mint dp; int size;
    DP(mint d = 1, int s = 0) : dp(d), size(s){}
    DP& operator+=(const DP& a) {
        size += a.size;
        dp *= mcomb(size, a.size) * a.dp;
        return *this;
    }
};

DP down[MAX], up[MAX];
mint ans[MAX];

void dfs(int s, int p = -1){
    for(int t : to[s]){
        if(t == p) continue;
        dfs(t, s);
        down[s] += down[t];
    }
    down[s].size += 1;
}

int main(){
    minit();
    int n; cin >> n;
    rep(i, n-1){
        int a, b; 
        cin >> a >> b; a--; b--;
        to[a].push_back(b);
        to[b].push_back(a);
    }

    dfs(0);

    queue<P> q;
    q.push(P(0, -1)); ans[0] = down[0].dp;
    while(!q.empty()){
        P p = q.front(); q.pop();
        for(int r : to[p.fi]){
            if(r == p.se) continue;
            q.push(P(r, p.fi));
        }
        if(p.se == -1) continue;
        up[p.fi].dp = ans[p.se] / down[p.fi].dp / mcomb(n-1, down[p.fi].size);
        up[p.fi].size = n - down[p.fi].size;
        ans[p.fi] = down[p.fi].dp * up[p.fi].dp * mcomb(n-1, up[p.fi].size);
    }

    rep(i, n) out(ans[i]);
}

Measured memory_bytes: 29684