#include <bits/stdc++.h>

using namespace std;

#define INF 100000000
#define YJ 1145141919
#define INF_INT_MAX 2147483647
#define INF_LL 9223372036854775
#define INF_LL_MAX 9223372036854775807
#define EPS 1e-10
#define MOD 1000000007
#define MOD9 998244353
#define Pi acos(-1)
#define LL long long
#define ULL unsigned long long
#define LD long double

#define int long long

using II = pair<int, int>;

int gcd(int a, int b) { return b != 0 ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a * b / gcd(a, b); }
int extgcd(int a, int b, int &x, int &y) { int g = a; x = 1; y = 0; if (b != 0) g = extgcd(b, a % b, y, x), y -= (a / b) * x; return g; }

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(a)  begin((a)), end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())

struct ModInt {
  static void setMod(int m) {
    mod = m;
  }

  ModInt(int val = 0) : val(val%mod) {}

  inline const ModInt operator + (const ModInt& rhs) const {
    return ModInt((this->val + rhs.val) % mod);
  }

  inline const ModInt operator - (const ModInt& rhs) const {
    return ModInt((this->val + mod - rhs.val) % mod);
  }

  inline const ModInt operator * (const ModInt& rhs) const {
    return ModInt((this->val * rhs.val) % mod);
  }

  inline ModInt& operator += (const ModInt& rhs) {
    this->val = (this->val + rhs.val) % mod;
    return *this;
  }

  inline ModInt& operator -= (const ModInt& rhs) {
    this->val = (this->val + mod - rhs.val) % mod;
    return *this;
  }

  inline ModInt& operator *= (const ModInt& rhs) {
    this->val = (this->val * rhs.val) % mod;
    return *this;
  }

  int val;
  static int mod;
};
int ModInt::mod = 1000000007;

const int MAX_N = 200005;
int N;
vector<int> E[MAX_N];

ModInt kai[MAX_N];
bool used[MAX_N];
ModInt calcKai(int k) {
  if (k <= 1) {
    return 1;
  }
  if(used[k]) {
    return kai[k];
  } else {
    used[k] = true;
    return kai[k] = calcKai(k-1) * k;
  }
}

ModInt calcInv(int a) {
  ModInt ret = 1;
  ModInt tmp = a;
  int k = ModInt::mod-2;

  while(k) {
    if (k&1) {
      ret *= tmp;
    }
    tmp *= tmp;
    k /= 2;
  }

  return ret;
}

ModInt dp1[MAX_N];
ModInt cnt1[MAX_N];

ModInt solve1(int pos = 0, int pre = -1) {
  ModInt ret = 1;
  ModInt cnt = 1; 

  vector<ModInt> vec1;
  vector<ModInt> vec2;
  for(int next : E[pos]) {
    if (next == pre) {
      continue;
    }
    vec2.push_back(solve1(next, pos));
    vec1.push_back(cnt1[next]);
    cnt += cnt1[next];
  }

  ret = calcKai(cnt.val-1);
  REP(i,vec1.size()) {
    ret *= calcInv(calcKai(vec1[i].val).val);
    ret *= vec2[i];
  }

  cnt1[pos] = cnt;
  return dp1[pos] = ret;
}

ModInt dp2[MAX_N];
ModInt solve2(int pos = 0, int pre = -1, ModInt preCnt = 0, ModInt preRet = 1) {

  ModInt cnt = 1; 

  vector<ModInt> vec1;
  vector<ModInt> vec2;
  cnt += preCnt; vec1.push_back(preCnt);
  vec2.push_back(preRet);

  for(int next : E[pos]) {
    if (next == pre) {
      continue;
    }
    vec2.push_back(dp1[next]);
    vec1.push_back(cnt1[next]);
    cnt += cnt1[next];
  }

  ModInt ret1 = calcKai(cnt.val-1);
  ModInt ret2 = 1;
  ModInt ret3 = 1;
  REP(i,vec1.size()) {
    ret3 *= calcKai(vec1[i].val);
    ret2 *= vec2[i];
  }

  dp2[pos] = ret1 * ret2 * calcInv(ret3.val);

  for(int next : E[pos]) {
    if (next == pre) {
      continue;
    }
    ModInt nextCnt = ModInt(N) - cnt1[next];
    ModInt nextRet = ret2 * calcInv(dp1[next].val) * calcKai((N-1-cnt1[next].val)) * calcInv((ret3 * calcInv(calcKai(cnt1[next].val).val)).val);

    solve2(next, pos, nextCnt, nextRet);
  }

  return dp2[pos];
}

signed main()
{
  cin >> N;
  REP(n,N-1) {
    int a,b; cin >> a >> b; a--; b--;
    E[a].push_back(b); E[b].push_back(a);
  }

  solve1();
  solve2();

  REP(n,N) {
    cout << dp2[n].val << endl;
  }

  return 0;
}


Measured memory_bytes: 30448