Codeforces Round 285 (Div. 1)
D
Misha and XOR
Codeforces
2700
原题
← CE →
翻译中…

After Misha's birthday he had many large numbers left, scattered across the room. Now it's time to clean up and Misha needs to put them in a basket. He ordered this task to his pet robot that agreed to complete the task at certain conditions. Before the robot puts a number $*x*$ to the basket, Misha should answer the question: is it possible to choose one or multiple numbers that already are in the basket, such that their XOR sum equals $*x*$?

翻译中…

If the answer is positive, you also need to give the indexes of these numbers. If there are multiple options of choosing numbers, you are allowed to choose any correct option. After Misha's answer the robot puts the number to the basket.

翻译中…

Initially the basket is empty. Each integer you put in the basket takes some number. The first integer you put into the basket take number $0$, the second integer takes number $1$ and so on.

翻译中…

Misha needs to clean up the place as soon as possible but unfortunately, he isn't that good at mathematics. He asks you to help him.

翻译中…

Input

翻译中…

The first line contains number $*m*$ ($1 ≤ *m* ≤ 2000$), showing how many numbers are scattered around the room.

翻译中…

The next $*m*$ lines contain the numbers in the order in which the robot puts them in the basket. Each number is a positive integer strictly less than $10^{600}$ that doesn't contain leading zeroes.

翻译中…

Output

翻译中…

For each number either print a $0$ on the corresponding line, if the number cannot be represented as a XOR sum of numbers that are in the basket, or print integer $*k*$ showing how many numbers are in the representation and the indexes of these numbers. Separate the numbers by spaces. Each number can occur in the representation at most once.

翻译中…

Note

翻译中…

The XOR sum of numbers is the result of bitwise sum of numbers modulo 2.

翻译中…

样例

Input #1
7
7
6
5
4
3
2
1
Output #1
0
0
0
3 0 1 2
2 1 2
2 0 2
2 0 1
InputCopy OutputCopy
Input #2
2
5
5
Output #2
0
1 0
InputCopy OutputCopy
题目信息
题号
504D
时间限制
2 s
内存限制
256 MB
标签
位运算

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。