#include <bits/stdc++.h>
using namespace std;
const auto start_time = std::chrono::high_resolution_clock::now();
void timecalculater(){
    #ifndef ONLINE_JUDGE
    auto end_time = std::chrono::high_resolution_clock::now();
    std::chrono::duration<double> diff = end_time-start_time;
    cerr<<"Time Taken : "<<diff.count()<<"\n";
    #endif
}
void __print(int x) {cout << x;}
void __print(long x) {cout << x;}
void __print(long long x) {cout << x;}
void __print(unsigned x) {cout << x;}
void __print(unsigned long x) {cout << x;}
void __print(unsigned long long x) {cout << x;}
void __print(float x) {cout << x;}
void __print(double x) {cout << x;}
void __print(long double x) {cout << x;}
void __print(char x) {cout << '\'' << x << '\'';}
void __print(const char *x) {cout << '\"' << x << '\"';}
void __print(const string &x) {cout << '\"' << x << '\"';}
void __print(bool x) {cout << (x ? "true" : "false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cout << '{'; __print(x.first); cout << ','; __print(x.second); cout << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cout << '{'; for (auto &i: x) cout << (f++ ? "," : ""), __print(i); cout << "}";}
void _print() {cout << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cout << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cout << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
#define rep(i, n) for(ll i = 0; i < (n); ++i)
#define repA(i, a, n) for(int  i = a; i <= (n); ++i)
#define all(x) x.begin(), x.end()
#define sz(x) (int) (x).size()
#define fill(a) memset(a, 0, sizeof(a))
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
#define endl '\n'
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long long int> vll;
typedef vector<pii> vii;
ll p=1e9+7;
const ll N=2e5+5;
ll fac[N];
ll invfac[N];
ll add(ll a,ll b){
    ll t=(a+b);
    if(t>=p)t-=p;
        return t;
}
ll power(ll a,ll x){
    ll r=1;
    while(x!=0){
        if(x%2==1){
            r=r*a;r%=p;
        }
        a=a*a;a%=p;
        x=x/2;
    }
    return r;
}
ll mul(ll a,ll b){
    ll t=(a*b);
    if(t>=p)t%=p;
    return t;
}
ll divide(ll a, ll b){
    return mul(a,power(b,p-2));
}
ll ans[N];
ll n;
vector<int> v[N];
ll sub[N];
ll f[N];
ll g[N];
void dfs(int i,int p){
    sub[i]=1;
    f[i]=1;
    for(auto j:v[i]){
        if(j==p)continue;
        dfs(j,i);
        f[i]=mul(f[i],f[j]);
        f[i]=divide(f[i],fac[sub[j]]);
        sub[i]+=sub[j];
    }
    f[i]=mul(f[i],fac[sub[i]-1]);
    return ;
}
void dfs1(int i,int p){
    g[i]=1;
    if(p!=-1){
        g[i]=divide(f[p],f[i]);
        g[i]=mul(g[i],fac[sub[i]]);
        g[i]=divide(g[i],fac[sub[p]-1]);
        g[i]=mul(g[i],divide(g[p],fac[(n-sub[p])]));
        g[i]=mul(g[i],fac[n-sub[i]-1]);
    }
    for(auto j:v[i]){
        if(j==p)continue;
        dfs1(j,i);
    }
    ans[i]=divide(f[i],fac[sub[i]-1]);
    ans[i]=mul(ans[i],mul(g[i],fac[n-1]));
    ans[i]=divide(ans[i],fac[n-sub[i]]);    
    return ;    
}
int main() {
    
    cin.sync_with_stdio(0); cin.tie(0);
    cin.exceptions(cin.failbit);
    int T=1;
    // cin>>T;
    fac[0]=1;
    for(ll i=1;i<N;i++){
        fac[i]=fac[i-1]*i;
        fac[i]%=p;
    }
    for(ll i=0;i<N;i++){
        invfac[i]=power(fac[i],p-2);
    }
    while(T--){
        cin>>n;
        rep(i,n-1){
            int x,y;cin>>x>>y;
            v[x].pb(y);v[y].pb(x);
        }
        dfs(1,-1);
        dfs1(1,-1);
        repA(i,1,n){
            cout<<ans[i]<<endl;
        }
    }   
    timecalculater();
    return 0;   
}   

Measured memory_bytes: 23284