//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; ++i)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = int64_t;
using ld = long double;
using P = pair<int, int>;
using vs = vector<string>;
using vi = vector<int>;
using vvi = vector<vi>;
template<class T> using PQ = priority_queue<T>;
template<class T> using PQG = priority_queue<T, vector<T>, greater<T> >;
const int INF = 100010001;
const ll LINF = (ll)INF*INF*10;
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) {return a < b && (a = b, true);}
template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) {return a > b && (a = b, true);}
template<typename T1, typename T2>
istream &operator>>(istream &is, pair<T1, T2> &p) { return is >> p.first >> p.second;}
template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) { return os << p.first << ' ' << p.second;}

const int mod = 1000000007;
//const int mod = 998244353;

struct mint {
  int64_t x;
  mint(int64_t 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 { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(int64_t 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) {return mint(*this) /= a;}
};

istream& operator>>(istream& is, mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

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

const int N = 2e5+10;

//head

int n;
vi G[N];
vector<mint> info[N];
vi sum[N];

inline void add(int i, int j) {
  G[i].emplace_back(j);
  info[i].emplace_back(1);
  sum[i].emplace_back(0);
}

pair<int, mint> dfs1(int i, int j) {
  int res = 0;
  mint fo(1);
  for(int id = 0; id < G[i].size(); id++) {
    int ne = G[i][id];
    if(ne == j) continue;
    auto u = dfs1(ne, i);
    sum[i][id] = u.first;
    info[i][id] = u.second;
    res += u.first;
    fo *= c.ifrac[u.first];
    fo *= info[i][id];
  }
  fo *= c.frac[res];
  return make_pair(res+1, fo);
}

void dfs2(int i, int j, int sss, mint fff) {
  mint ffo = fff * c.ifrac[sss];
  for(int id = 0; id < G[i].size(); id++) {
    int ne = G[i][id];
    if(ne == j) {
      sum[i][id] = sss;
      info[i][id] = fff;
    }
    else {
      ffo *= info[i][id];
      ffo *= c.ifrac[sum[i][id]];
    }
  }
  for(int id = 0; id < G[i].size(); id++) {
    int ne = G[i][id];
    if(ne == j) continue;
    dfs2(ne, i, n-sum[i][id], ffo*c.frac[sum[i][id]]*info[i][id].inv()*c.frac[n-1-sum[i][id]]);
  }
}


int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  rep(i, n-1) {
    int a, b;
    cin >> a >> b;
    a--; b--;
    add(a, b);
    add(b, a);
  }
  dfs1(0, -1);
  dfs2(0, -1, 0, 1);

  rep(i, n) {
    mint ans = c.frac[n-1];
    rep(id, G[i].size()) {
      //cout << i << ' ' << G[i][id] << ' ' << info[i][id] << endl;
      ans *= info[i][id];
      ans *= c.ifrac[sum[i][id]];
    }
    cout << ans << '\n';
  }
}

Measured memory_bytes: 54776