#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
#define ln '\n'
constexpr long long MOD = 1000000007LL;
//constexpr long long MOD = 998244353LL;
typedef long long ll;
typedef unsigned long long ull; 
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
template<class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true;} return false; }
template<class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true;} return false; }
///////////////////////////////////////////////////////////////////////////////////////////////////

template <std::uint_fast64_t Modulus> class modint {
  using u64 = std::uint_fast64_t;

public:
  u64 a;

  constexpr modint(const u64 x = 0) noexcept : a(x % Modulus) {}
  constexpr u64 &value() noexcept { return a; }
  constexpr const u64 &value() const noexcept { return a; }
  constexpr modint operator+(const modint rhs) const noexcept {
    return modint(*this) += rhs;
  }
  constexpr modint operator-(const modint rhs) const noexcept {
    return modint(*this) -= rhs;
  }
  constexpr modint operator*(const modint rhs) const noexcept {
    return modint(*this) *= rhs;
  }
  constexpr modint operator/(const modint rhs) const noexcept {
    return modint(*this) /= rhs;
  }
  constexpr modint &operator+=(const modint rhs) noexcept {
    a += rhs.a;
    if (a >= Modulus) {
      a -= Modulus;
    }
    return *this;
  }
  constexpr modint &operator-=(const modint rhs) noexcept {
    if (a < rhs.a) {
      a += Modulus;
    }
    a -= rhs.a;
    return *this;
  }
  constexpr modint &operator*=(const modint rhs) noexcept {
    a = a * rhs.a % Modulus;
    return *this;
  }
  constexpr modint &operator/=(modint rhs) noexcept {
    u64 exp = Modulus - 2;
    while (exp) {
      if (exp % 2) {
        *this *= rhs;
      }
      rhs *= rhs;
      exp /= 2;
    }
    return *this;
  }
};

using mint = modint<MOD>;

int N;
const int MAX = 201010;
mint dp[201010];
mint kai[201010];
mint ans[201010];
int ch[201010];
vector<int> G[201010];

void dfs1(int v, int pv) {
    dp[v] = 1;
    mint waru = 1;
    for (auto nv : G[v]) {
        if (pv==nv) continue;
        dfs1(nv,v);
        dp[v] *= dp[nv];
        ch[v] += ch[nv];
        waru *= kai[ch[nv]];
    }
    dp[v] *= kai[ch[v]];
    dp[v] /= waru;
    ch[v]++;
    return;
}

void dfs2(int v, int pv, mint val) {
    ans[v] = dp[v]*val*kai[N-1];
    ans[v] /= kai[ch[v]-1];
    for (auto nv : G[v]) {
        if (nv==pv) continue;
        mint k = ans[v];
        k /= kai[N-1];
        k *= kai[N-1-ch[nv]];
        k *= kai[ch[nv]];
        k /= dp[nv];

        k /= kai[N-ch[nv]];
        dfs2(nv,v,k);
    }
}

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    cin >> N;
    rep(i,N-1) {
        int a,b; cin >> a >> b;
        --a; --b;
        G[a].emplace_back(b);
        G[b].emplace_back(a);
    }
    kai[0] = 1;
    rep(i,MAX-1) {
        kai[i+1] = kai[i]*(i+1);
    }
    dfs1(0,-1);
    dfs2(0,-1,1);
    //cout << "ko" << ln;
    //rep(i,N) cout << ch[i] << ln;
    //cout << "dp" << ln;
    //rep(i,N) cout << dp[i].a << ln;
    //cout << "ans" << ln;
    rep(i,N) {
        cout << ans[i].a << ln;
    }
}


Measured memory_bytes: 19444