#P2097. Tree Constructer
Tree Constructer
题目描述
点击查看pdf
MianKing has a Graph Constructer : The input of it is a sequence and the output of it is an undirected graph with nodes, edge is in this graph if and only if
For example, if the input is , the output is the graph
Now GreenKing has a tree with nodes, MianKing wants to find a sequence as input to get this tree. You need to help him find a sequence satisfy the condition.
输入格式
The first line has one integer .
Then there are lines, each line has two integers denotes an edge in the tree.
.
输出格式
Output integers denotes the sequence you find.
You should guaranteed that
It's guaranteed that the solution always exists.
样例
3
1 2
2 3
1 1152921504606846974 1
提示
Form 2020ICPC济南站