#include<bits/stdc++.h> 
using namespace std; 
vector<vector<int> > neighbours(200000);
int parent[200000];
pair<int,int> ways[200000];
int num_ways[200000];


vector<int> factorial;
vector<int> factorial_inv;
int mod;
void setmod(int x){
    	mod = x;
}
long long modu(long long p){
		return ((p%mod)+mod)%mod;
}
int modu(int p){
	return ((p%mod)+mod)%mod;
}
long long gcdExtended(int a, int b, long long *x, long long *y); 

	// Function to find modulo inverse of a 
int modInverse(int a) 
{ 
	    long long x, y; 
	    long long g = gcdExtended(a, mod, &x, &y); 
	    if (g != 1) 
	        return 1; 
	    else
	    { 
	        // m is added to handle negative x 
	        int res = (x%mod + mod) % mod; 
	        return  res; 
	    } 
} 
	  
	// C function for extended Euclidean Algorithm 
long long gcdExtended(int a, int b, long long *x, long long *y) 
{ 
	    // Base Case 
	    if (a == 0) 
	    { 
	        *x = 0, *y = 1; 
	        return (long long) b; 
	    } 
	  
	    long long x1, y1; // To store results of recursive call 
	    long long gcd = gcdExtended(b%a, a, &x1, &y1); 
	  
	    // Update x and y using results of recursive 
	    // call 
	    *x = y1 -  x1*(b/a); 
	    *y = x1; 
	  
	    return gcd; 
	} 


void create_fact(int x){
		factorial.resize(x+1);
		factorial[0] = 1;
		for(int j=1;j<=x;j++){
			factorial[j] = modu(1LL*factorial[j-1]*j);
		}
}
void create_fact_inv(int x){
		factorial_inv.resize(x+1);
		factorial_inv[0] = 1;
		for(int j=1;j<=x;j++){
			factorial_inv[j] = modInverse(1LL*factorial[j]);
		}
}
long long ncr(int p,int q){
		long long  x = modu(1LL*factorial[p]*factorial_inv[q]);
		long long  y = modu(x*factorial_inv[p-q]);
		return y;
}
int fact(int x){
	return factorial[x];
}
int fact_inv(int x){
	return factorial_inv[x];
}
//setmod(x)
//create_fact(x)
//create_fact_inv(x)
//fact(x)
//fact_inv(x);
//ncr
void dfs(int node){
	//cout<<"Node"<<endl;
	int num = 0;
	for(int j=0;j<neighbours[node].size();j++){
		if(neighbours[node][j]!=parent[node]){
			parent[neighbours[node][j]] = node;
			dfs(neighbours[node][j]);
			
			num = num + ways[neighbours[node][j]].first;
		}
	}
	long long s = 1;
	int chosen = 0;
	for(int j=0;j<neighbours[node].size();j++){
		if(neighbours[node][j]!=parent[node]){
			s = modu(modu(s * ways[neighbours[node][j]].second)*ncr(num - chosen,ways[neighbours[node][j]].first));
		    chosen = chosen+ ways[neighbours[node][j]].first;
		}
		
	}
	ways[node].second = (int) s;
	ways[node].first = num+1;
}

int main(){
	
	int N;
	cin>>N;
	setmod(1000000007);
	create_fact(N);
	create_fact_inv(N);
	for(int j=0;j<N-1;j++){
		int a,b;
		cin>>a>>b;
		a--;b--;
		neighbours[b].push_back(a);
		neighbours[a].push_back(b);
	}
	
	parent[0] = 0;
	dfs(0);
//	cout<<"ways"<<endl;
//	for(int jj=0;jj<N;jj++){
//		cout<<ways[jj].second<<" ";
//	}
//	cout<<endl;
	int current = 0;
	num_ways[0] = ways[0].second;
	queue<int> q;
	q.push(current);
	while(!q.empty()){
		current = q.front();
	//	cout<<current<<endl;
		int chosen = 0;
		if(current!=0){
			long long s = (long long) num_ways[parent[current]];
			s = modu(s* modInverse(ncr(N-1,ways[current].first)));
			s = modu(s * ncr(N-1,ways[current].first-1));
			num_ways[current] = (int) s;
			
		}
		q.pop();
		for(int j=0;j<neighbours[current].size();j++){
			if(neighbours[current][j] != parent[current]){
				q.push(neighbours[current][j]);
			}
		}
	}
	for(int j=0;j<N;j++){
		cout<<num_ways[j]<<endl;
	}
	return 0;
}


Measured memory_bytes: 19444