#P1582F1. Korney Korneevich and XOR (easy version)
Korney Korneevich and XOR (easy version)
Description
This is an easier version of the problem with smaller constraints.
Korney Korneevich dag up an array of length . Korney Korneevich has recently read about the operation bitwise XOR, so he wished to experiment with it. For this purpose, he decided to find all integers such that there exists an increasing subsequence of the array , in which the bitwise XOR of numbers is equal to .
It didn't take a long time for Korney Korneevich to find all such , and he wants to check his result. That's why he asked you to solve this problem!
A sequence is a subsequence of a sequence if can be obtained from by deletion of several (possibly, zero or all) elements.
A sequence is called increasing if .
The first line contains a single integer ().
The second line contains integers () — the elements of the array .
In the first line print a single integer — the number of found values.
In the second line print integers in increasing order () — found values.
Input
The first line contains a single integer ().
The second line contains integers () — the elements of the array .
Output
In the first line print a single integer — the number of found values.
In the second line print integers in increasing order () — found values.
Samples
Note
In the first test case:
- To get value it is possible to choose and empty subsequence
- To get value it is possible to choose a subsequence
- To get value it is possible to choose a subsequence
- To get value it is possible to choose a subsequence