• محدودیت زمان: ۱ ثانیه
  • محدودیت حافظه: ۲۵۶ مگابایت

We have a city with nn apartments labeled with postal codes 11 to nn. The ii-th road in this city, connects apartments aia_i and bib_i. Consider delivering food orders to each apartment in the city in the following manner:

For each k=1,2,...,nk = 1, 2, ..., n, Snapp Food wants to solve the following problem:

  • First, deliver order 11 to apartment kk.
  • Then, for each of the food orders 2,,n2, …, n in this sequence, deliver the order to the apartment chosen as follows: Choose an apartment that still does not have an order delivered to it and is adjacent to an apartment with an order already delivered to it. If there are multiple such apartments, choose one of them at random.

Find the number of ways in which we can deliver orders to the apartments, modulo 109+710^9 + 7

input

The first line of the input is the number of apartments nn. The following nn lines, each define a road from apartment aia_i to bib_i.

2n2000002 \leq n \leq 200 000 1ai,bin1 \leq a_i, b_i\leq n

output

For each k=1,2,...,nk = 1, 2, ... , n in this sequence, print a line containing the answer to the problem.

example

sample input 1

3
1 2
1 3
Plain text

sample output 1

2
1
1
Plain text

sample input 2

5
1 2
2 3
3 4
3 5
Plain text

sample output 2

2
8
12
3
3
Plain text

ارسال پاسخ برای این سؤال
فایلی انتخاب نشده است.