You are given a tree $$$T$$$ with $$$n$$$ vertices. Edge $$$i$$$ $$$(1 \le i \le n-1)$$$ connects vertices $$$u_i$$$ and $$$v_i$$$, $$$T$$$ is rooted at $$$x$$$ $$$(1 \le x \le n)$$$
You have to construct the lexicographically smallest $$$n$$$-permutation $$$p$$$ such that the following condition holds:
Note: Ancestors of the vertex $$$u$$$ are all vertices on the path from the root $$$x$$$ to the vertex $$$u$$$ , except the vertex $$$u$$$ itself.
The first line contains integers $$$n$$$ and $$$x$$$ $$$(2 \le n \le 2 \cdot 10^5)$$$ — the number of vertices in the tree and the root.
The next $$$n-1$$$ lines contain integers $$$u_i$$$ and $$$v_i$$$ $$$(1 \le v_i, u_i \le n)$$$ — the vertices that the $$$i$$$-th edge connects.
It is guaranteed that this set of edges forms a tree.
The lexicographically smallest $$$n$$$-permutation that satisfies the given condition
5 3 3 5 1 5 1 2 4 1
3 4 1 5 2
10 3 5 4 8 3 4 6 5 3 7 9 1 3 5 10 2 9 9 8
2 5 1 7 6 8 9 3 4 10
For the first example:
For the second example:
| Название |
|---|


