bool DBG = false;
// #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
// #pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
//#include <boost/multiprecision/cpp_dec_float.hpp>
//#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using ll = long long;
using ld = long double;
//using i128 = __int128_t;
//using bint = boost::multiprecision::cpp_int
//using d1024 = boost::multiprecision::number<mp::cpp_dec_float<1024>>;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define IFOR(i,a,b) for(int i=(b-1);i>=(a);--i)
#define RPT(i,a,b) for(int i=(a);i<((a)+(b));++i)
#define IRPT(i,a,b) for(int i=((a)+(b)-1);i>=(a);--i)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
#define fs first
#define sd second
#define couts(x) cout << (x) << (" ")
#define coutn(x) cout << (x) << ("\n")
#define dcouts(x) if(DBG) couts(x)
#define dcoutn(x) if(DBG) coutn(x)
#define endl "\n"
#define psb push_back
#define ppb pop_back
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define LBIT(x,a) (((x)>>(a))&1LL)
#define IBIT(x,a) (((x)>>(a))&1)
#define BCOUNT(x) (__builtin_popcount(x))
template<typename T> std::istream &operator>>(std::istream &is, std::vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T1, typename T2> std::istream &operator>>(std::istream &is, std::pair<T1,T2> &p){is >> p.first >> p.second; return is; }
template<typename T> std::ostream &operator<<(std::ostream &os, const std::vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> std::ostream &operator<<(std::ostream &os, const std::deque<T> &vec){ os << "deque["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> std::ostream &operator<<(std::ostream &os, const std::set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> std::ostream &operator<<(std::ostream &os, const std::unordered_set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> std::ostream &operator<<(std::ostream &os, const std::multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> std::ostream &operator<<(std::ostream &os, const std::unordered_multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T1, typename T2> std::ostream &operator<<(std::ostream &os, const std::pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; }
template<typename TK, typename TV> std::ostream &operator<<(std::ostream &os, const std::map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
template<typename TK, typename TV> std::ostream &operator<<(std::ostream &os, const std::unordered_map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }

template<class T> using V = vector<T>;
template<class T> using V2 = V<V<T>>;
template<class T> using V3 = V<V2<T>>;


template<class T>
V<T> VF(V<T> v, function<T(T)> f){
  int n = (int) v.size();
  V<T> ret(n);
  for(int i=0; i<n; ++i) {
    T a = v[i];
    ret[i] = f(a);
  }
  return ret;
}
template<class T, class U>
V<U> VF2(V<T> v, function<U(T)> f){
  int n = (int) v.size();
  V<U> ret(n);
  for(int i=0; i<n; ++i) {
    T a = v[i];
    ret[i] = f(a);
  }
  return ret;
}
template<class T>
void VFS(V<T> &v, function<T(T)> f){
  int n = (int) v.size();
  for(int i=0; i<n; ++i) {
    T a = v[i];
    v[i] = f(a);
  }
  return;
}

void twoview(ll x){
  cout << "0x";
  IFOR(j,0,62){
    cout << LBIT(x,j);
  }
}

ll modpow(ll a, ll n, ll m) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a % m;
		a = a * a%m; n >>= 1;
	}
	return res;
}

using P = pair<int,int>;
using PL = pair<int,ll>;// size, free


//global
constexpr ll mod = 1e9+7;
int n; 
V2<int> g;
V<ll> fract, invfract, all;
map<P,PL> tr;

inline ll comb(int a, int b){
  ll ret = fract[a];
  (ret *= invfract[b]) %= mod;
  (ret *= invfract[a-b]) %= mod;
  return ret;
}

PL dfs(int s, int par = -1){
  PL ret; //ll ret2 = fract[n-1];
  ret.fs = 1; ret.sd = 1;
  for(auto x: g[s]){
    if(x==par) continue;
    PL e = dfs(x,s);
    ret.fs += e.fs;
    (ret.sd *= e.sd ) %= mod;
    (ret.sd *= invfract[e.fs]) %= mod;
    
    (all[s] *= invfract[ e.fs  ]) %= mod;
    (all[s] *= e.sd  ) %= mod;
  }
  (ret.sd *= fract[ret.fs-1] ) %= mod;
  tr[P(par,s)] = ret;
  
  
  //all[s] = ret2;
  return ret;
}



void dfs3(int s, int par = -1){
  for(auto x: g[s] ){
    if(x==par) continue;
    P e = P(s,x), erev = P(x,s);
    PL ret(n,all[s]);
    ret.fs -= tr[e].fs;
    (ret.sd *= invfract[n-1]     ) %= mod;
    (ret.sd *= fract[ret.fs-1]   )%=mod;
    (ret.sd *= fract[ tr[e].fs ]           ) %= mod;
    (ret.sd *= modpow(tr[e].sd, mod-2,mod) ) %= mod;
    tr[erev] = ret;
    (all[x] *= invfract[ret.fs] ) %= mod;
    (all[x] *= ret.sd ) %= mod;
    dfs3(x,s);
  }
}



void solve(){
  cin >> n;
  g = V2<int>(n);
  FOR(i,0,n-1){
    int a, b;
    cin >> a >> b;
    --a, --b;
    g[a].psb(b);
    g[b].psb(a);
  }
  fract = V<ll>(3*n+10);
  invfract = V<ll>(3*n+10);
  fract[0] = 1;
  FOR(i,0,3*n) (fract[i+1] = fract[i]*(ll)(i+1) ) %= mod;
  FOR(i,0,3*n) (invfract[i] = modpow(fract[i],mod-2,mod) ) %= mod;
  all = V<ll>(n,fract[n-1]);
  dfs(0);
  //coutn(all);
  dfs3(0);
  FOR(i,0,n){
    coutn(all[i]);
  }
}
 
 
 
int main(void){
  //std::cout << std::fixed << std::setprecision(20);
  cin.tie(0);
  ios::sync_with_stdio(false);
  solve();
  return 0;
}



Measured memory_bytes: 49908