- Time limit: 1.00 s
- Memory limit: 512 MB
You are given an array of integers. Consider the xors of all subsets of the array (including the empty subset with xor equal to zero).
Your task is to find the smallest subset xors.
Input
The first line has two integers and : the size of the array and the number of subset xors .
The next line has integers : the contents of the array.
Output
Print integers: the smallest subset xors in increasing order.
Constraints
Example
Input:
4 9 3 5 14 8
Output:
0 0 3 3 5 5 6 6 8