You are given an integer N. To solve the problem, you must find the minimum number of elements that must be removed from the set S={1,2,...,N} such that the bitwise XOR of the remaining elements is 0.
Input format
Output format
For each test case, print a single line.
The first integer k represents the minimum number of elements and you must remove from S. Then, k space-separated integers a1,a2,...,ak follows representing the elements that you have to remove from S.
If there are multiple possible solutions, output the lexicographically largest one. A solution a1,a2,...,ak is lexicographically larger than solution b1,b2,...,bk, if ai>bi where i is the smallest index where ai≠bi.
It can be proved that in an optimal solution k≤31.
After removing 1 there are no elements left. Therefore XOR of the remaining elements becomes 0.
After removing 1 and 2 there are no elements left. Therefore XOR of the remaining elements becomes 0.
We don't need to remove any element as XOR of 1, 2, and 3 is already 0.
After removing 4 we are left with 1,2 and 3 whose XOR is 0.