#include <bits/stdc++.h>
#define int long long
#define MAXN 200005
#define mod 1000000007
using std::vector;
int n,i,x,f[MAXN],size[MAXN];
vector<int> G[MAXN];
bool vis[MAXN];
inline void read(int &x)
{
	short negative=1;
    x=0;
    char c=getchar();
    while(c<'0' || c>'9')
    {
    	if(c=='-')
			negative=-1;
		c=getchar();
	}
    while(c>='0' && c<='9')
        x=(x<<3)+(x<<1)+(c^48),c=getchar();
    x*=negative;
}
inline void print(int x)
{
    if (x<0)
        putchar('-'),x=-x;
    if (x>9)
        print(x/10);
    putchar(x%10+'0');
}
inline int ksm(int a,int n,int p)
{
	int Ret(1);
	while (n)
	{
		if (n&1)
			(Ret*=a)%=p;
		(a*=a)%=p,n>>=1;
	}
	return Ret;
}
inline void dfs(int u)
{
	vis[u]=true,size[u]=1;
	for (int i=0;i<G[u].size();i++)
	{
		int v=G[u][i];
		if (vis[v])
			continue;
		dfs(v);
		size[u]+=size[v];
	} 
	(f[1]*=size[u])%=mod;
}
inline void dfs2(int u)
{
	vis[u]=true;
	for (int i=0;i<G[u].size();i++)
	{
		int v=G[u][i];
		if (vis[v])
			continue;
		f[v]=f[u]*((n-size[v])*ksm(size[v],mod-2,mod)%mod)%mod;
		dfs2(v);
	}
}
signed main(void)
{
	read(n);
	for (i=1;i<n;i++)
	{
		int u,v;
		read(u),read(v);
		G[u].push_back(v);
		G[v].push_back(u);
	}
	f[1]=1;
	dfs(1);
	memset(vis,false,sizeof(vis));
	dfs2(1);
	for (i=x=1;i<=n;i++)
		(x*=i)%=mod;
	for (i=1;i<=n;i++)
		print((x*ksm(f[i],mod-2,mod))%mod),putchar('\n');
	return 0;
}