#pragma target("avx")
#include <bits/stdc++.h>

using namespace std;

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

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef unordered_map<ll, ll> U_MAP;
typedef priority_queue<ll> pq;
typedef priority_queue<ll, vector<ll>, greater<ll>> rpq;
constexpr ll INF = 1e9, MOD = 1e9 + 7, ohara = 1e6 + 10;
constexpr ll LINF = 1e18;

#define rep(i, n) for (ll(i) = 0; (i) < (int)(n); (i)++)
#define rrep(i, a, b) for (ll i = (a); i < (b); i++)
#define rrrep(i, a, b) for (ll i = (a); i >= (b); i--)
#define all(v) (v).begin(), (v).end()
#define Size(n) (n).size()
#define Cout(x) cout << (x) << endl
#define doublecout(a) cout << fixed << setprecision(15) << a << endl;
#define fi first
#define se second
#define m_p make_pair
#define p_b push_back
string to_string(string s) { return '"' + s + '"'; }
string to_string(const char *s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

//------ Believe yourself as a genius!!!!!! ------

int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
// int dy[]={-1,0,1,-1,1,-1,0,1};int dx[]={-1,-1,-1,0,0,1,1,1};
string alph("abcdefghijklmnopqrstuvwxyz"), s;
ll n, cnt, ans, a[ohara], b[ohara], c, d, tmp, m, h, w, x, y, sum, k, q;
V g[ohara];
P p[ohara];
ll p_cou, f[ohara], fr[ohara];
bool vi[ohara];

void dfs1(ll now, ll dep) {
  if (vi[now]) return;
  vi[now] = true;
  p[p_cou++] = m_p(dep, now);
  rep(i, Size(g[now])) { dfs1(g[now][i], dep + 1); }
}

ll mod_pow(ll xx, ll nn, ll mod) {
  ll ret = 1;
  while (nn > 0) {
    if (nn & 1) ret = ret * xx % mod;
    xx = xx * xx % mod;
    nn >>= 1;
  }
  return ret;
}

ll ncr(ll nn, ll r) {
  if (nn < r) return 0;
  return f[nn] * fr[r] % MOD * fr[nn - r] % MOD;
}

int main(void) {
  cin.tie(0);
  cout.tie(0);
  ios::sync_with_stdio(false);

  using mint = modint<MOD>;

  cin >> n;
  rep(i, n - 1) {
    cin >> a[i] >> b[i];
    a[i]--;
    b[i]--;
    g[a[i]].p_b(b[i]);
    g[b[i]].p_b(a[i]);
  }

  f[0] = 1;
  rrep(i, 1, n + 3) { f[i] = f[i - 1] * i % MOD; }
  fr[n + 2] = mod_pow(f[n + 2], MOD - 2, MOD);
  rrrep(i, n + 1, 0) { fr[i] = fr[i + 1] * (i + 1) % MOD; }

  vector<pair<mint, mint>> dp(n + 100);
  vector<mint> kai(n + 100);
  rep(i, n + 10) dp[i] = m_p(0, 0);
  kai[1] = 1;
  rrep(i, 2, n + 10) kai[i] = kai[i - 1] * i;

  dfs1(0LL, 0LL);
  sort(p, p + p_cou);
  reverse(p, p + p_cou);
  rep(i, p_cou) {
    ll now = p[i].se;
    if (Size(g[now]) == 1 && now != 0)
      dp[now] = m_p(1, 1);
    else {
      mint res = 1;
      ll chi = 0;
      rep(j, Size(g[now])) {
        if (dp[g[now][j]].fi.value() == 0) continue;
        res *= dp[g[now][j]].fi.value();
        chi += dp[g[now][j]].se.value();
        res /= kai[dp[g[now][j]].se.value()];
      }
      res *= kai[chi];
      dp[now] = m_p(res, chi + 1);
    }
  }
  //ここまではただの木DP
  //ここから寄与矢印を打ち消して再度計算を繰り返し、全ての根の答えを求める
  //これが全方位木DP
  // BFS的に探索

  rep(i, n + 10) vi[i] = false;
  queue<ll> que;
  que.push(0);

  while (!que.empty()) {
    ll moto = que.front();
    que.pop();
    vi[moto] = 1;
    mint res = 1;
    rep(i, Size(g[moto])) {
      ll to = g[moto][i];
      if (vi[to] == 0) {
        que.push(to);
        res *= dp[to].fi.value();
        res /= kai[dp[to].se.value()];
      } else {
        res *= dp[to].fi.value();
        res /= kai[n - dp[moto].se.value()];
      }
    }
    if (moto == 0) continue;
    res /= dp[moto].fi.value();
    res /= ncr(n - 1, dp[moto].se.value());
    res *= kai[n - 1];
    dp[moto].fi = res;
  }
  rep(i, n) Cout(dp[i].fi.value());
  return 0;
}

Measured memory_bytes: 56560