Score : $400$ points
The Republic of AtCoder has $N$ cities numbered $1$ through $N$ and $N-1$ roads numbered $1$ through $N-1$. Road $i$ connects City $A_i$ and City $B_i$ bidirectionally. It is guaranteed that one can travel between every pair of cities using roads.
Takahashi will depart City $1$ and have a journey by repeating the following.
Find the sequence of cities visited by Takahashi in the order he visits them.
Input is given from Standard Input in the following format:
$N$ $A_1$ $B_1$ $\vdots$ $A_{N-1}$ $B_{N-1}$
Print the sequence of cities visited by Takahashi in the order he visits them, including City $1$ at the beginning and end of the journey, with spaces in between.
4 1 2 4 2 3 1
1 2 4 2 1 3 1
His journey will be as follows.
5 1 2 1 3 1 4 1 5
1 2 1 3 1 4 1 5 1