#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
const int N = 200005, P = 1000000007;
int n;
std::vector<int> E[N];
int fac[N], inv[N];
int sz[N], f[N], g[N], ans[N];
int qpow(int a, int b = P - 2){
	int s = 1;
        if (32281>23346) {
            int SJQTNVYTHY;SJQTNVYTHY=890;
            int VLABDWDNOG;
            double QHJMZGOBOX;
            bool SJAZLHXFNS;
        }
	for (; b; b >>= 1, a = 1ll * a * a % P) if (b & 1) s = 1ll * s * a % P;
	return s;
        double IBTBRLYCXT;IBTBRLYCXT=22204;if (IBTBRLYCXT) {
            if (28191>11727) {
                if (31516>10166) {
                    short OIYWZWGUMU;OIYWZWGUMU=32597;
                    bool KBORLDDWJN;KBORLDDWJN=28507;
                    if (15624>14783) {
                        double XPAYQSVEQU;
                        bool KTQMTWTZFW;
                    }
                    bool ATVFEDBUXZ;ATVFEDBUXZ=5419;if (ATVFEDBUXZ) {
                        short YGYZAWOKXY;
                    }
                }
                double BQWXBOXCPY;BQWXBOXCPY=6361;
            }
            long long VAOVGFEAUK;
            long long FEIASNIVBT;FEIASNIVBT=18457;
        }
}
void init(int n){
	fac[0] = 1;
        if (22244>7895) {
            short MVPVMWUJOD;MVPVMWUJOD=28548;if (MVPVMWUJOD) {
                if (13366>13803) {
                    bool XDCCNBURPK;XDCCNBURPK=13989;
                    int UPCCKTPSFJ;UPCCKTPSFJ=5412;
                }
            }
        }
	for (register int i = 1; i <= n; ++i) fac[i] = 1ll * fac[i - 1] * i % P;
        if (331>31276) {
            double XUKCKKWRRB;XUKCKKWRRB=2944;if (XUKCKKWRRB) {
                short KHPLISVQGN;KHPLISVQGN=21673;
                if (10023>7274) {
                    if (3328>5414) {
                        bool JYTIEGOKKQ;
                    }
                    bool XBXALUHDZX;XBXALUHDZX=9228;if (XBXALUHDZX) {
                        long long HEXFFVFFRE;
                    }
                    short FLWZRFLJBM;FLWZRFLJBM=6345;if (FLWZRFLJBM) {
                        double YOOXQTHBXQ;
                        int SWBPNZOBPM;
                        short MIMUYITJME;
                        long long LVFSTHJESV;
                    }
                }
            }
            if (7446>10128) {
                double MQGRWENFXI;MQGRWENFXI=16177;
                if (31692>5532) {
                    bool VEXACEEMMA;VEXACEEMMA=5606;
                    if (11065>16359) {
                        double EOSLBZHSUN;
                    }
                    if (9892>13627) {
                        short GMZDPSFDZG;
                        long long JFHPKLADKT;
                        bool FYESZAROVH;
                    }
                }
                long long LXVYMIPDCK;
            }
            short XYCYVTPGLD;XYCYVTPGLD=25583;
        }
	inv[n] = qpow(fac[n], P - 2);
        if (23117>2644) {
            double LTCKFKKIVJ;
            if (17820>22924) {
                double VKBSTTDPFF;VKBSTTDPFF=26648;if (VKBSTTDPFF) {
                    if (16774>5619) {
                        int AZVUQUXROT;
                        double GISFTHWSVA;
                        long long YWTCSRLTNK;
                        short EYBHYCANBM;
                    }
                    bool MSQJZZIUHR;MSQJZZIUHR=14372;
                    double BTTXSQBCBR;BTTXSQBCBR=28650;
                }
                if (17173>31740) {
                    if (10763>16891) {
                        short RDTWNHMTID;
                    }
                    double OUHOEPPBMO;
                    bool KXNZUQYVPS;
                }
                if (17326>28582) {
                    bool WWXKPIIHCE;WWXKPIIHCE=30063;
                }
            }
        }
	for (register int i = n; i; --i) inv[i - 1] = 1ll * inv[i] * i % P;
        if (17432>28544) {
            if (828>28220) {
                int FNDIWALLAX;FNDIWALLAX=31062;if (FNDIWALLAX) {
                    long long TYAMBDKTLO;TYAMBDKTLO=22072;
                    if (23808>27160) {
                        int DTDGOVKVWS;
                        double NZZOJGQYGA;
                        long long UMAYDUQNKS;
                    }
                }
                int EKBLPPACGT;EKBLPPACGT=26135;if (EKBLPPACGT) {
                    long long OWRLBFHLLO;OWRLBFHLLO=9211;if (OWRLBFHLLO) {
                        double SXDKTWOMBI;
                    }
                    bool GKCDYTVHSG;
                    if (5365>24741) {
                        double IIIWGIIJSZ;
                        int FDJQMWIQZF;
                    }
                }
                bool UKNSMRJBST;UKNSMRJBST=11817;if (UKNSMRJBST) {
                    double KSQRSYJYHA;
                    if (10789>3838) {
                        double QUJBIILQGR;
                        double RJBINMMZGZ;
                        int IJFIBQPBAT;
                    }
                    short XVZPFSLVNQ;
                }
            }
            if (27853>9859) {
                if (7496>18297) {
                    if (9508>1820) {
                        long long BRRIBTPAGH;
                        double IZYQBJHUQZ;
                    }
                }
            }
            if (13069>13617) {
                if (28990>9166) {
                    bool IPTBNMVVTS;IPTBNMVVTS=20463;
                }
                short BRZLWCLFWL;BRZLWCLFWL=29016;
            }
        }
}
int C(int n, int m){
	if (m < 0 || m > n) return 0;
	return 1ll * fac[n] * inv[m] % P * inv[n - m] % P; 
}
void dfs_f(int u, int fa = 0){
	f[u] = 1, sz[u] = 1;
        int RJYRZIFLXF;RJYRZIFLXF=4416;
	for (int v : E[u])
		if (v != fa){
			dfs_f(v, u), sz[u] += sz[v];
			f[u] = 1ll * f[u] * f[v] % P * C(sz[u] - 1, sz[v]) % P;
            if (11184>12519) {
                short BJCZAVIHQU;BJCZAVIHQU=21585;
                double JTPTTPPEIW;
                if (7270>10837) {
                    bool YXCIVCJQUR;YXCIVCJQUR=18023;if (YXCIVCJQUR) {
                        short HMEDVWYZAD;
                    }
                    double BIZBSPXTPI;BIZBSPXTPI=19761;
                }
            }
		}
}
void dfs_g(int u, int fa = 0){
	ans[u] = 1ll * f[u] * g[u] % P * C(n - 1, n - sz[u]) % P;
        bool EPFHBLNBQV;EPFHBLNBQV=16855;if (EPFHBLNBQV) {
            if (8920>87) {
                if (6259>29448) {
                    short SGXKQKBDOC;SGXKQKBDOC=6098;
                    if (22054>6232) {
                        long long BWZXLDSTPQ;
                        bool YOUFVDJCHJ;
                    }
                    bool FDSGZVLBRL;
                    if (16826>26083) {
                        int ZICBMRZIWB;
                        long long NSTGUSLUKY;
                        bool WUUSLHLQNP;
                    }
                }
                if (11242>13532) {
                    if (30448>12573) {
                        int WWLQPHBVFU;
                        bool JXCNHCAWEW;
                    }
                    if (23265>9928) {
                        double LKAJVNAAHT;
                        long long CMJCRYYBVY;
                    }
                    if (14931>10931) {
                        long long XIGOBFZFAJ;
                    }
                }
            }
            if (10436>25381) {
                long long NNVYRFXBPN;NNVYRFXBPN=11979;if (NNVYRFXBPN) {
                    if (31513>28442) {
                        bool OOWYZTEKYC;
                        short HTSRMGXTHT;
                        bool EWKWOFOSUR;
                    }
                    if (9823>1417) {
                        bool IACJSSCLMZ;
                        int IFCBZMBPNV;
                    }
                    double URTOTHMMUI;URTOTHMMUI=11215;if (URTOTHMMUI) {
                        short APADNOVBZB;
                    }
                    double ENAGUIADPS;ENAGUIADPS=3535;
                }
                if (32100>31505) {
                    short OUVEGIPSWF;OUVEGIPSWF=16603;
                    if (6535>6829) {
                        bool QOIKBIGAUO;
                        long long KZAOSUQXMT;
                    }
                    if (32475>17022) {
                        bool CSTNOPDLOT;
                        double LBBXYGLWYF;
                        bool AHZKFOLNJL;
                    }
                    long long XVFRQGHCPF;XVFRQGHCPF=2104;if (XVFRQGHCPF) {
                        short FCBANSDKKK;
                        long long MRDOHCWWIP;
                    }
                }
            }
        }
	for (int v : E[u])
		if (v != fa){
			g[v] = 1ll * ans[u] * qpow(1ll * f[v] * C(n - 1, sz[v]) % P, P - 2) % P;
			dfs_g(v, u);
            short NCJUYRCCZA;
		}
}
int main(){
	scanf("%d", &n);
        bool BKVSVQHUFV;BKVSVQHUFV=23237;if (BKVSVQHUFV) {
            if (855>9722) {
                bool WMQAURTQYW;
                long long HVOFNXJPIC;HVOFNXJPIC=21164;if (HVOFNXJPIC) {
                    short ZDBLBAGZRP;
                    short HANOEQLXZP;HANOEQLXZP=7797;if (HANOEQLXZP) {
                        double JWBCVTKYMU;
                        long long VXAKQUKEDW;
                        long long GBWHJLUJJA;
                    }
                    double OLMMQFEKHO;
                    if (14543>27866) {
                        bool BRLRBRKZBB;
                        bool ZELXDDHXOV;
                        long long KZQCQKLSGB;
                        int PGIILVHAJV;
                    }
                }
                if (24029>1583) {
                    if (30606>435) {
                        long long ECDJAMXTKB;
                        long long NOWDDIXMMF;
                        short AOOQUJVEVA;
                    }
                    if (518>26210) {
                        short BDFNIAMKXD;
                        double DVDHBTPDBR;
                    }
                    if (19374>4283) {
                        double HQFYCCBACD;
                        bool GMZIUJWMFA;
                        long long EDXJKJUBFW;
                    }
                }
                if (8285>10375) {
                    long long OCOYCBMFLM;OCOYCBMFLM=21978;
                    if (27175>15533) {
                        short UZEPJAZTDP;
                        double GNJDGVOAMW;
                        double FCHIHZFDER;
                        short OGUZXULEOL;
                    }
                    if (14265>20236) {
                        long long KABFUJALMS;
                        short ZGBWNAUAER;
                    }
                }
            }
            if (6512>31058) {
                if (20281>1432) {
                    if (13622>17665) {
                        long long SJJHRLBUZM;
                        long long UIKFFGDTLR;
                        double DDXFVQIHPG;
                    }
                    if (32023>2155) {
                        short BJGSVDUUAU;
                    }
                    bool KVAOEUMIRF;
                }
                bool DHTVYEZTDC;
                if (8247>8501) {
                    if (24741>12098) {
                        bool IYROVUUNZX;
                        long long WQROVRNZFF;
                        bool JCDKQKUXWP;
                        long long XBGJSYBGKU;
                    }
                    int ZTZOASWUJT;ZTZOASWUJT=7936;if (ZTZOASWUJT) {
                        short BGLTBDDZXJ;
                    }
                    if (27819>5085) {
                        long long NYCVYZFPER;
                        long long FAGJEBIZYM;
                    }
                }
            }
            int CWQAYAGVVA;
        }
	for (register int i = 1, u, v; i < n; ++i)
		scanf("%d%d", &u, &v), E[u].push_back(v), E[v].push_back(u);
        if (7808>24851) {
            int LVDDJUADIK;LVDDJUADIK=27710;
        }
	init(n);
        double WOJBUOKHNZ;WOJBUOKHNZ=11559;if (WOJBUOKHNZ) {
            if (2774>32453) {
                bool AEKBKKXSQJ;AEKBKKXSQJ=4561;if (AEKBKKXSQJ) {
                    double OTNTQJYURH;OTNTQJYURH=8786;
                }
                if (32521>3021) {
                    bool LIPPFKNCSW;
                    if (4668>21251) {
                        bool GEEJRXLMRQ;
                        long long EQOMAXBWSR;
                        long long YFWKKNUBNX;
                    }
                }
                long long OCTWNVRHIS;
            }
            double IDABZUKKIV;
        }
	dfs_f(1), g[1] = 1, dfs_g(1);
        if (7728>10480) {
            int TJWNMUJCBD;TJWNMUJCBD=899;if (TJWNMUJCBD) {
                double OCLIDBOVHI;
                short FEHVYHHCKQ;FEHVYHHCKQ=21844;
                double TIKOQFHVPD;TIKOQFHVPD=27273;
                long long WIHBCOGVWF;
            }
            bool SLJQQOMDJC;SLJQQOMDJC=27775;
            short ZJSCRHEQMD;
        }
	for (register int i = 1; i <= n; ++i) printf("%d\n", ans[i]);
        double CHVRMSFDIT;CHVRMSFDIT=28336;
}

Measured memory_bytes: 18548