You are given a tree with $$$n$$$ vertices, numbered $$$1, 2, \ldots, n$$$. For two vertices $$$x$$$ and $$$y$$$, let $$$d(x, y)$$$ denote the number of edges on the unique simple path between $$$x$$$ and $$$y$$$ in the tree.
For distinct nodes $$$a$$$ and $$$b$$$, we say that node $$$a$$$ dominates node $$$b$$$ if the number of vertices $$$x$$$ such that $$$d(a, x) \lt d(b, x)$$$ is strictly more than the number of vertices $$$y$$$ such that $$$d(a, y) \gt d(b, y)$$$.
You want to order the $$$n$$$ vertices such that for any $$$a, b$$$, if $$$a$$$ dominates $$$b$$$, then $$$a$$$ appears before $$$b$$$ in the order. Find such an ordering, or claim that it doesn't exist.
The first line contains a single integer $$$t(1 \le t \le 3 \cdot 10^5)$$$, the number of test cases. Then the testcases follow:
The sum of $$$n$$$ over all testcases does not exceed $$$3 \cdot 10^5$$$.
For each test case:
261 22 32 43 53 621 2
YES 2 3 1 4 5 6 YES 1 2
In the first testcase, the ordered domination pairs are the following:
The ordering $$$3, 2, 4, 5, 1, 6$$$ is also valid, among others.
| Name |
|---|


