Hello Folks,

Sorry for the very very long interruption between the daily dose.I will be regular from now.

The following is the day 7 question.

You are given a list of numbers and you will have a continuous flow of numbers coming in the list.

For every new number you need to tell that whether that number could be made using the numbers previously available in the list.

INPUT

The first line contains number *m* (1 ≤ *m* ≤ 2000), showing how many numbers are there goo be in the list.

The next *m* lines contain the numbers in the order in which the numbers are being put in the list. 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 list, 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.

Assume that the list was initially empty.

Sample test(s)

Output

0
0
0
3 0 1 2
2 1 2
2 0 2
2 0 1

Comment any ideas or your way of approach to the question.

### Like this:

Like Loading...

*Related*

Do put the link of online judge, so that we can try it online.

LikeLike

Yes. I agree with Ajay. If you plan to put a problem directly from online judge, no need to copy paste the question here. Putting the link will be more feasible than copying the question here. Also, you can put the improved editorial of the question instead of the question.

LikeLike