Given an array arr which contains data of N nodes of Complete Binary tree in level order fashion. The task is to print the level order traversal in sorted order.
The first line of the input contains integer T denoting the number of test cases. For each test case, the first line takes an integer n denoting the size of array i.e number of nodes followed by n-space separated integers denoting the nodes of the tree in level order fashion.
For each test case, the output is the level order sorted tree. Note: For every level, we only print distinct elements.
1 <= T <= 100
1 <= n <= 104
1 <= arr[i] <= 104