#P2097. Tree Constructer

Tree Constructer

题目描述

点击查看pdf

MianKing has a Graph Constructer : The input of it is a sequence a1...n (0leqailt260)a_{1...n}~(0\\leq a_i \\lt 2^{60}) and the output of it is an undirected graph with nn nodes, edge (x,y)(x,y) is in this graph if and only if (ax or ay)=2601(a_x~or~a_y)= 2^{60}-1

For example, if the input is , the output is the graph

Now GreenKing has a tree with nn 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 nn.

Then there are n1n-1 lines, each line has two integers (x,y)(x,y) denotes an edge in the tree.

1leqnleq1001\\leq n\\leq 100.

输出格式

Output nn integers a1...na_{1...n} denotes the sequence you find.

You should guaranteed that 0leqai<2600\\leq a_i<2^{60}

It's guaranteed that the solution always exists.

样例

3 
1 2 
2 3 

1 1152921504606846974 1

提示

Form 2020ICPC济南站