##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
You are given a tree with vertices. Vertex has a value .
For every ordered pair of vertices with , write down the xor of all values on the simple path from to .
There are exactly written numbers.
Find the -th smallest number among them.
The written numbers are: : path , xor . After sorting, the first one is .
The written numbers are: : path , xor . : path , xor . : path , xor . : path , xor . After sorting them as , the third one is .
The sorted written numbers are . The fifth one is .
The sorted written numbers are . The seventh one is .
The sorted written numbers are . The twelfth one is .