#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, int> i_i;

#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define ALL(v) v.begin(), v.end()
#define SZ(x) ((ll)(x).size())

const double PI  = acos(-1.0);
const double EPS = 1e-9;
const ll INF = 1e9+10;
const ll MOD = 1e9+7;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
#define print(x) cerr << #x << " is " << x << endl;
//#define print(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl; 

//#include<bits/stdc++.h>
//using namespace std;
//using ll = long long;
//using ld = long double;

const int N_MAX = 2e5 + 1;
vector<vector<int>> g(N_MAX);
map<int, ll> dp[N_MAX];
map<int, int> dp0[N_MAX];
int N;

//ax + by = gcd(a, b) �𖞂��� x, y ��Ԃ�
ll extgcd (ll a, ll b, ll& x, ll& y){
    ll d = a;
    if (b != 0){
        d = extgcd(b, a % b, y, x);
        y -= (a/b) * x;
    } else {
        x = 1; y = 0;
    }
    return d;
}

// ax == 1 (mod m)�𖞂��� x
ll mod_inverse(ll a, ll m){
    ll x, y;
    extgcd(a, m, x, y);
    return (m + x % m) % m;
}

// n! = a p^e �Ƃ����Ƃ��� a mod p �����߂� O(p log_p n)
#define P_MAX 200007
ll fact[P_MAX]; // n! mod p �̃e�[�u�� O(p)
ll init(ll mod){
    fact[0] = 1;
    for (ll n = 1; n < P_MAX; n++){
        fact[n] = fact[n - 1] * n %mod;
        
        //cout << n << " " << fact[n] << endl;
    }
    return 0;
}
ll mod_fact(ll n, ll p, ll& e){ // init()��������Ŏ��s
    e = 0;
    if (n == 0) return 1;
    
    // p �̔{���̕������v�Z
    ll res = mod_fact(n/p, p, e);
    e += n/p;
    // (p - 1)!  ==  -1 �Ȃ̂� (p -1)! ^ (n/p) ��n/p �̋����Ōv�Z�ł���
    if (n / p % 2 != 0) return res * (p - fact[n % p]) % p;
    return res * fact[n % p] % p;
}

int dfs0(int i, int p, int f) {
    if(dp0[i].count(p)) 
        return dp0[i][p];
    int cnt = 0;
    if(f || p == -1) {
        for(int j : g[i]) if(j != p) {
            cnt += dfs0(j, i, f);
        }
    } else {
        cnt = dfs0(i, -1, f) - dfs0(p, i, f) - 1; 
    }
    cnt++;
    return dp0[i][p] = cnt;
}

ll dfs(int i, int p, int f) {
    if(dp[i].count(p)) 
        return dp[i][p];
    ll res = 1LL;
    
    if(f || p == -1) {
        for(int j : g[i]) if(j != p) {
            (res *= dfs(j, i, f))%=MOD;
            //res *= dfs(j, i, f);
        }
    } else {
        res = dfs(i, -1, f);
        ll tmp = (dfs(p, i, f) * dfs0(i, -1, 0))%MOD;
        tmp = mod_inverse(tmp, MOD);
        (res *= tmp) %= MOD;
        
        //res = dfs(i, -1, f)/dfs(p, i, f)/dfs0(i, -1, 0);
        
    }
    (res *= dp0[i][p]) %= MOD;
    return dp[i][p] = res;
}
int main() {

    cin >> N;
    rep(i, N - 1){
        int a, b;
        cin >> a >> b;
        a--;
        b--;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    dfs0(0, -1, 1);
    rep(i, N)dfs0(i, -1, 0);
    
    
    //rep(i, N) cout << "dfs0[" << i << "] = " << dfs0(i, -1, 0) << endl;
    
    //init(MOD);
    //ll e1;
    //ll f = mod_fact(N, MOD, e1);
    
    ll f = 1LL;
    rep(i, N)(f *= (i + 1))%=MOD;
    //cout << "fact = " << f << endl;
    dfs(0, -1, 1);
    rep(i, N){
        //cout << fact/dfs(i, -1, 0) << endl;
        
        ll tmp = mod_inverse(dfs(i, -1, 0), MOD);
        cout << (f * tmp)%MOD << endl;
    }
  return 0;
}



Measured memory_bytes: 98292