#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n); i++)
#define rep3(i, s, n) for (int i = s; i > (int)(n); i--)
#define all(obj) obj.begin(), obj.end()
#define db(x) cerr << #x << ":" << x << " "
#define dbl(x) cerr << #x << ":" << x << "\n"
#define dbv(vec) cerr << #vec << ":"; for (auto e : vec) cerr << e << " "; cout << "\n"
#define dbvv(vv) cerr << #vv << ":\n"; for (auto vec : vv) { for (auto e : vec) cerr << e << " "; cerr << "\n"; }
#define dbm(map) cerr << #map << ":"; for (auto p : map) cerr << "(" << p.first << ", " << p.second << "), "; cerr << "\n";
#define YN(f) cout << (f ? "YES" : "NO") << "\n"
#define Yn(f) cout << (f ? "Yes" : "No") << "\n"
#define yn(f) cout << (f ? "yes" : "no") << "\n"
using ll = long long;
using vi = vector<int>; using vl = vector<ll>; using vs = vector<string>; using vb = vector<bool>;
using vvi = vector<vi>; using vvl = vector<vl>; using vvb = vector<vb>;
using pii = pair<int, int>; using pll = pair<ll, ll>;
using vpii = vector<pii>; using vpll = vector<pll>;
using ti3 = tuple<int, int, int>; using tl3 = tuple<ll, ll, ll>;
using mii = map<int, int>; using mil = map<int, ll>; using mli = map<ll, int>; using mll = map<ll, ll>;

const int MOD = 1000000007; // 998244353;

ll modadd(ll x, ll y) {
	ll xp = x % MOD;
	if (x < 0) x += MOD;
	ll yp = y % MOD;
	if (y < 0) y += MOD;
	return (x + y) % MOD;
}

ll modsub(ll x, ll y) {
	return modadd(x, -y);
}

ll modmul(ll x, ll y) {
	return x * y % MOD;
}

// power(mod) x^n
ll modpow(ll x, ll n) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = modmul(res, x);
		x = modmul(x, x);
		n >>= 1;
	}
	return res;
}

// inverse(mod) x^(-1)
ll inv(ll x) {
	return modpow(x, MOD - 2);
}

ll moddiv(ll x, ll y) {
	return modmul(x, inv(y));
}

int N;

vvi g, ch;
vb r1, r2;
vl dp1, dp2; // 場合の数 dp1:1を根とし，葉の方に進む（計算は葉から根にボトムアップに行う） dp2:葉から根の方に進む（計算は根1から葉にトップダウンに行う）
vi n; // 頂点の総数 n[i]:i及びこれより葉側にある頂点の総数
vl f; // 階乗前計算

void dfs1(int u) {	
	r1[u] = true;
	for (int v : g[u]) {
		if (r1[v]) continue;
		dfs1(v);
		dp1[u] = modmul(dp1[u], moddiv(dp1[v], f[n[v]]));
		n[u] += n[v];
		ch[u].push_back(v);
	}
	dp1[u] = modmul(dp1[u], f[n[u] - 1]);
	//db l(u);
	//db v(dp1);
}

void dfs2(int u) {
	r2[u] = true;
	int m = ch[u].size();
	vi L(m, 1), R(m, 1);
	rep(i, m - 1) {
		int v = ch[u][i], w = ch[u][m - 1 - i];
		L[i + 1] = modmul(L[i], moddiv(dp1[v], f[n[v]]));
		R[m - 1 - i - 1] = modmul(R[m - 1 - i], moddiv(dp1[w], f[n[w]]));	
	}
	rep(i, m) {
		int v = ch[u][i];
		dp2[v] = modmul(L[i], R[i]);
		dp2[v] = modmul(dp2[v], moddiv(dp2[u], f[N - n[u]]));
		dp2[v] = modmul(dp2[v], f[N - 1 - n[v]]);		
		dfs2(v);
	}
	//db l(u);
	//db v(dp2);
}

int main() {
	cin >> N;
	g.assign(N + 1, {}); ch.assign(N + 1, {});
	r1.assign(N + 1, false); r2.assign(N + 1, false);	
	dp1.assign(N + 1, 1); dp2.assign(N + 1, 1); n.assign(N + 1, 1);
	dp1[0] = dp2[0] = n[0] = 0;
	f.assign(1, 1); rep2(i, 1, N + 1) f.push_back(modmul(f[i - 1], i));
	//db v(f);
	rep(i, N - 1) {
		int a, b; cin >> a >> b;
		g[a].push_back(b); g[b].push_back(a);
	}
	//db vv(g);
	dfs1(1);
	//db v(dp1);		
	//db vv(ch);
	dfs2(1);
	//db v(dp2);
	rep2(i, 1, N + 1) {
		ll ans = modmul(dp1[i], dp2[i]);
		ans = modmul(ans, f[N - 1]);
		ans = moddiv(ans, modmul(f[N - n[i]], f[n[i] - 1]));
		cout << ans << endl;
	}
}

Measured memory_bytes: 27632