//#include <cstdio>
#include <iostream>

#include <cstring>

#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
//#include <queue>
//#include <stack>
#include <cassert>

using namespace std;

#define SZ(a) int((a).size())
#define REP(i,n) for(int i=0,_n=(n);i<_n;++i)
#define FOR(i,a,b) for(int i=(a),_b=(b);i<=_b;++i)

#define DEBUG(x) cerr << #x << ": " << x << endl

typedef long long llong;
typedef vector<int> VI;
typedef vector<VI> VVI;

#define PMOD 1000000007
#define MAXN 200000
int F[MAXN+1];
int invF[MAXN+1];
void build_factorial_tables() {
   F[0] = 1;
   for (int i = 1; i <= MAXN; ++i)
      F[i] = (F[i-1] * 1LL * i) % PMOD;

   VI inv(MAXN+1);
   inv[0]  = inv[1]  = 1;
   invF[0] = invF[1] = 1;
   for (int i = 2; i <= MAXN; ++i) {
   // inv[i] = (-(PMOD/i) * 1LL * inv[PMOD % i] ) % PMOD + PMOD;
      inv[i] = (PMOD - (PMOD / i) * 1LL * inv[PMOD % i] % PMOD) % PMOD;
      invF[i] = (invF[i-1] * 1LL * inv[i]) % PMOD;
   }
}

int nCk(int n, int k) {
   if (n < 0 || k < 0 || k > n)  // invalid n or k
      return 0;
   long long res = F[n];
   res = (res * invF[k]) % PMOD;
   res = (res * invF[n-k]) % PMOD;
   return res;
}

// http://codeforces.com/blog/entry/17881?#comment-227516
int mod_inverse(int a, int m) {
   return a < 2 ? a : ((1 - m * 1LL * mod_inverse(m % a, a)) / a % m + m) % m;
}


int N;
VI adj[MAXN+1];

int subtree_size[MAXN+1];
void dfs0(int u, int p = -1) {
   subtree_size[u] = 1;
   int p_cid = -1;
   REP(j, SZ(adj[u])) {
      int v = adj[u][j];
      if (v == p) {
         p_cid = j;
         continue;
      }
      dfs0(v, u);
      subtree_size[u] += subtree_size[v];
   }
   if (p_cid > 0)
      swap(adj[u][p_cid], adj[u][0]);
}

llong dp_down[MAXN+1];
void dfs1(int u) {
   if (SZ(adj[u]) == 1) {
      // u is a leaf
      dp_down[u] = 1;
      return;
   }

   llong& res = dp_down[u];
   int sub_sz = subtree_size[u] - 1;
   res = 1;
   FOR(j, 1, SZ(adj[u])-1) {
      int v = adj[u][j];
      dfs1(v);
      res = (res * dp_down[v]) % PMOD;
      res = (res * nCk(sub_sz, subtree_size[v])) % PMOD;
      sub_sz -= subtree_size[v];
   }
}

llong dp[MAXN+1];
void dfs2(int u, llong dp_up = 1) {
   llong& res = dp[u];
   res = (dp_down[u] * dp_up) % PMOD;
   res = (res * invF[ subtree_size[u]-1 ]) % PMOD;
   res = (res * F[N-1]) % PMOD;
   res = (res * invF[ N-subtree_size[u] ]) % PMOD;

   FOR(j, 1, SZ(adj[u])-1) {
      int v = adj[u][j];
      
      llong dp_up_for_v = dp[u];
      // remove subtree rooted at v
      
      dp_up_for_v = (dp_up_for_v * invF[N-1]) % PMOD;
      dp_up_for_v = (dp_up_for_v * F[N - 1 - subtree_size[v]]) % PMOD;
      dp_up_for_v = (dp_up_for_v * F[ subtree_size[v] ]) % PMOD;
      
      dp_up_for_v = (dp_up_for_v * mod_inverse(dp_down[v], PMOD)) % PMOD;
      
      dfs2(v, dp_up_for_v);
   }
}

int main(int argc, char* argv[]) {
   ios_base::sync_with_stdio(false); 
   cin.tie(nullptr);

   build_factorial_tables();

   cin >> N;
   if (N == 2) {
      cout << "1\n";
      cout << "1\n";
      return 0;
   }

   REP(j, N-1) {
      int u, v;
      cin >> u >> v;
      adj[u].push_back(v);
      adj[v].push_back(u);
   }

// adj[0].push_back(1);
   adj[1].push_back(0);

   dfs0(1, 0);

   dfs1(1);

   dfs2(1);

   FOR(k, 1, N)
      cout << dp[k] << '\n';

   return 0;
}


Measured memory_bytes: 19440