#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define all(a) (a).begin(), (a).end()

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; }

using ll = long long;

const ll mod = 1000000007;

struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  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;
  }
};

struct combination {
  std::vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
};

ll N;
std::vector<ll> G[200010];
mint dp1[200010], dp2[200010], fact[200010];
ll subtree[200010];
combination comb( 200010 );
mint ans = 0;

ll dfs( ll v, ll p )
{
  ll ret = 1;

  for( auto u : G[v] ) if( u != p )
    ret += dfs( u, v );
  
  return subtree[v] = ret;
}

mint dfs1( ll v, ll p )
{
  mint ret = 1;
  mint coef = comb.fact[subtree[v]-1];

  for( auto u : G[v] ) if( u != p )
  {
    dfs1( u, v );
    ret *= dp1[u];
    coef *= comb.ifact[subtree[u]];
  }

  ret *= coef;

  return dp1[v] = ret;
}

void dfs2( ll v, ll p )
{
  for( auto u : G[v] ) if( u != p )
  {
    mint add = dp1[v]*comb.ifact[N-1]*comb.fact[N-1-subtree[u]]*comb.fact[subtree[u]]/dp1[u];
    dp1[u] = dp1[u]*comb.ifact[subtree[u]-1]*comb.fact[N-1]*comb.ifact[N-subtree[u]]*add;
    dfs2( u, v );
  }
}

int main()
{
  std::cin >> N;

  rep( i, N-1 )
  {
    ll a, b;
    std::cin >> a >> b;
    --a; --b;
    G[a].emplace_back( b );
    G[b].emplace_back( a );
  }

  dfs( 0, -1 );
  dfs1( 0, -1 );

  rep( i, N )
    dp2[i] = 1;

  dfs2( 0, -1 );

  /*rep( i, N )
    printf( "subtree[%d] = %lld\n", i, subtree[i] );
  rep( i, N )
    printf( "dp1[%d] = %lld\n", i, dp1[i] );*/

  rep( k, N )
    std::cout << (dp1[k]).x << std::endl;

  return 0;
}

Measured memory_bytes: 24048