//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ld long double
#define al(a) (a).begin(),(a).end()
#define mk make_pair
#define check cout<<"?"<<endl;

ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;

vector<ll> mul;
vector<ll> inv,fac;

void inverse(ll n){
    //要素数:n+1 (0~n)
    inv[0]=1;
    inv[1]=1;
    for(ll i=2;i<=n;i++){
        inv[i]=(MOD-inv[MOD%i]*(MOD/i))%MOD;
    }
}

void inverse_u(ll n){
    //要素数:n+1 (0~n)
    for(ll i=2;i<=n;i++){
        inv[i]=(inv[i]*inv[i-1])%MOD;
    }
}

void factorial(ll n){
    //要素数:n+1 (0~n)
    fac[0]=1;
    fac[1]=1;
    for(ll i=2;i<=n;i++){
        fac[i]=(fac[i-1]*i)%MOD;
    }
}

ll nCr(ll n,ll r){
    return fac[n]*inv[r]%MOD*inv[n-r]%MOD;
}

ll proinverse(ll x,ll m){
    ll res=1,M=m-2;
    while(M>0){
        if(M&1) res=res*x%m;
        x=x*x%m;
        M>>=1;
    }
    return res;
}

struct edge{
    ll to;
    ll dp;
    ll node;
};

vector<vector<edge>> path;

void dfs(ll x,ll from,ll ind){
    rep(i,path[x].size()) 
    {if(path[x][i].to!=from) dfs(path[x][i].to,x,i);}
    path[from][ind].node=1;
    path[from][ind].dp=1;
    for(auto &to : path[x]){
        if(to.to==from) continue;
        path[from][ind].node+=to.node;
        path[from][ind].dp=(path[from][ind].dp*to.dp)%MOD;
        path[from][ind].dp=(path[from][ind].dp*inv[to.node])%MOD;
    }
    path[from][ind].dp=(MOD+path[from][ind].dp*fac[path[from][ind].node-1])%MOD;
  //cout<<from+1<<" "<<(path[from][ind].dp+MOD)%MOD<<endl;
}

int main() {
    ll n; cin>>n;
    mul.assign(n,1);
    path.assign(n,vector<edge>(0));
    inv.assign(n+1,0);
    fac.assign(n+1,0);
    inverse(n);
    inverse_u(n);
    factorial(n);
    rep(i,n-1){
        ll a,b; cin>>a>>b;
        a--; b--;
        path[a].push_back((edge){b,0,0});
        path[b].push_back((edge){a,0,0});
    }
    rep(i,path[0].size()) dfs(path[0][i].to,0,i);
    mul.assign(n,fac[n-1]);
    queue<tuple<ll,ll,ll>> que;
    rep(i,path[0].size()){
        mul[0]=(mul[0]*inv[path[0][i].node])%MOD;
        mul[0]=(mul[0]*path[0][i].dp)%MOD;
        que.push(make_tuple(path[0][i].to,0,i));
    }
    while(!(que.empty())){
        ll x,from,ind;
        tie(x,from,ind)=que.front();
        que.pop();
        for(auto &to : path[x]){
            if(to.to!=from) continue;
            to.dp=mul[from]*proinverse(path[from][ind].dp,MOD)%MOD;
            to.dp=to.dp*proinverse(nCr(n-1,path[from][ind].node),MOD)%MOD;
            to.node=n-path[from][ind].node;
          //cout<<x+1<<" "<<(to.dp+MOD)%MOD<<endl;
        }
        rep(i,path[x].size()){
            mul[x]=(mul[x]*inv[path[x][i].node])%MOD;
            mul[x]=(mul[x]*path[x][i].dp)%MOD;
            if(path[x][i].to!=from) que.push(make_tuple(path[x][i].to,x,i));
        }
        
        
    }
    rep(i,n){
            ll ans=fac[n-1];
            for(auto to : path[i]){
                ans=(ans*inv[to.node])%MOD;
                ans=(ans*to.dp)%MOD;
              //cout<<(to.dp+MOD)%MOD<<endl;
            }
      cout<<(ans+MOD)%MOD<<endl;
      //cout<<(mul[i]+MOD)%MOD<<endl;
    }   
  //rep(i,4)cout<<path[2][i].node<<endl;
}

Measured memory_bytes: 27820