#include <bits/stdc++.h>
#define FOR(i, a, b) for(int i = (a);i < (b);++i)
#define FORR(i, b, a) for (int i = (b) - 1;i >= 0;--i)
#define REP(i, n) for(int i = 0;i < (n);++i)
#define REPR(i, n) for(int i = (n) - 1;i >= 0;--i)
#define ITER(itr, v) for(auto itr = v.begin();itr != v.end();++itr)
#define SORT(v) sort(v.begin(), v.end())
#define REV(v) reverse(v.begin(), v.end())
#define SIZE(v) int(v.size())
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

const int p = 1000000007;
class Zp {
	ll x;
public:
	Zp(ll X) :x((X + p) % p) { ; }
	Zp() :x(0) { ; }
	Zp &operator=(ll y) { return *this = Zp(y); }
	Zp operator-() const { return Zp(-x); }
	Zp operator+(ll y) const { return Zp(x + y); }
	Zp &operator+=(ll y) { return *this = *this + y; }
	Zp operator-(ll y) const { return Zp(x - y); }
	Zp &operator-=(ll y) { return *this = *this - y; }
	Zp operator*(ll y) const { return Zp(x * y); }
	Zp &operator*=(ll y) { return *this = *this * y; }
	Zp operator/(ll y) const { return *this * Zp(y).inv(); }
	Zp &operator/=(ll y) { return *this = *this / y; }
	Zp operator+(const Zp &r) const { return *this + r.x; }
	Zp &operator+=(const Zp &r) { return *this += r.x; }
	Zp operator-(const Zp &r) const { return *this - r.x; }
	Zp &operator-=(const Zp &r) { return *this -= r.x; }
	Zp operator*(const Zp &r) const { return *this * r.x; }
	Zp &operator*=(const Zp &r) { return *this *= r.x; }
	Zp operator/(const Zp &r) const { return *this / r.x; }
	Zp &operator/=(const Zp &r) { return *this /= r.x; }
	Zp pow(int i) const {
		if (i == 0) return Zp(1);
		if (i % 2) return *this * pow(i - 1);
		Zp tmp = pow(i / 2);
		return tmp * tmp;
	}
	Zp inv() const { return pow(p - 2); }
	ll get() const { return x; }
	bool operator==(ll y) { return x == y; }
	bool operator!=(ll y) { return !(*this == y); }
	friend istream &operator>>(istream &istr, Zp &z) { return istr >> z.x; }
	friend ostream &operator<<(ostream &ostr, const Zp &z) { return ostr << z.x; }
};
class Comb {
	int n;
	vector<Zp> fact, ifact;
public:
	Comb(int N) :n(N), fact(N + 1), ifact(N + 1) {
		fact[0] = 1;
		REP(i, n) fact[i + 1] = fact[i] * (i + 1);
		ifact[n] = fact[n].inv();
		REPR(i, n) ifact[i] = ifact[i + 1] * (i + 1);
	}
	Zp operator()(int k, int r) {
		return fact[k] * ifact[r] * ifact[k - r];
	}
};

class Tree {
	int n;
	vector<vector<int>> edge;
	vector<Zp> dp;
	vector<int> t;
	Comb comb;
public:
	Tree(int N) :n(N), edge(N), dp(N), t(N), comb(N) { ; }
	void unite(int i, int j) {
		edge[i].emplace_back(j);
		edge[j].emplace_back(i);
	}
	pair<Zp, int> dfs(int i = 0, int p = -1) {
		Zp res = 1;
		int num = 0;
		int m = edge[i].size();
		REP(k, m) {
			int j = edge[i][k];
			if (j == p) continue;
			Zp f;
			int s;
			tie(f, s) = dfs(j, i);
			res *= f * comb(num + s, s);
			num += s;
		}
		dp[i] = res;
		t[i] = num;
		return { res,num + 1 };
	}
	void dfs2(int i = 0, int p = -1) {
		int m = edge[i].size();
		REP(k, m) {
			int j = edge[i][k];
			if (j == p) continue;
			dp[j] = dp[i] * comb(n - 1, t[j]) / comb(n - 1, t[j] + 1);
			dfs2(j, i);
		}
	}
	void print() {
		dfs();
		dfs2();
		REP(i, n) cout << dp[i] << endl;
	}
};

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

	int N;
	cin >> N;
	Tree tree(N);
	REP(i, N - 1) {
		int a, b;
		cin >> a >> b;
		--a;
		--b;
		tree.unite(a, b);
	}
	tree.print();

	return 0;
}


Measured memory_bytes: 19444