Factor-Full Tree
문제
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 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 with a positive integer so that is an ancestor of if and only if divides .
After constructing such a labelling, Aivar can simply forget about the tree and just think about the list of numbers .
You are given a rooted tree with vertices, and your task is to find a divisor labelling. The vertices are numbered from to , and is the root.
입력
The first line contains an integer ().
The following lines each contain two integers and (, ), meaning that an edge goes between vertices and . These edges will form a tree.
출력
Print one line with integers, the numbers . These numbers must satisfy . 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