PivotOJ

Factor-Full Tree

시간 제한: 1000ms메모리 제한: 1024MB출처: NCPC 2023BOJ 30437

문제

Aivar is very good at number theory. In fact, it is the only thing he is good at, but this doesn't stop him from achieving great things. However, if Aivar wants to solve any problem in life, he first needs to convert it to number theory.

For example, consider a rooted tree with NN vertices. In order to deal with such structures, Aivar first constructs a divisor labelling of the tree. A divisor labelling is a way to label each vertex vv with a positive integer xvx_v so that vv is an ancestor of uu if and only if xvx_v divides xux_u.

After constructing such a labelling, Aivar can simply forget about the tree and just think about the list of numbers x1,x2,,xNx_1, x_2, \dots, x_N.

You are given a rooted tree with NN vertices, and your task is to find a divisor labelling. The vertices are numbered from 11 to NN, and 11 is the root.

입력

The first line contains an integer NN (1N601 \leq N \leq 60).

The following N1N-1 lines each contain two integers uu and vv (1u,vN1 \leq u, v \leq N, uvu \neq v), meaning that an edge goes between vertices uu and vv. These edges will form a tree.

출력

Print one line with NN integers, the numbers x1,x2,xNx_1, x_2, \dots x_N. These numbers must satisfy 1xi10181 \leq x_i \leq 10^{18}. It can be shown that under these constraints, an answer always exists.

예제

예제 1

입력
5
1 2
1 3
3 4
3 5
출력
1 2 3 21 33
이 문제는 채점 준비 중입니다. 테스트 데이터가 확보되면 제출이 가능합니다.