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.


-----Examples-----
Input
7
7
6
5
4
3
2
1

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

Input
2
5
5

Output
0
1 0



-----Note-----

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

Source: codeforces | Difficulty: VERY_HARD
Tags: Bit manipulation


Solutions:
m = int(input())
b = []
k = []
for i in range(m):
	x = int(input())
	c = 0
	for j in range(len(b)):
		v = b[j]
		d = k[j]
		if x ^ v < x:
			x ^= v
			c ^= d
	if x != 0:
		print(0)
		c ^= 2 ** i
		b.append(x)
		k.append(c)
	else:
		a = []
		for j in range(m):
			if c & 1 == 1:
				a.append(j)
			c >>= 1
		print(len(a), end='')
		for v in a:
			print(' ', v, sep='', end='')
		print()


m = int(input())
values = []
idx = []
for i in range(m):
	x = int(input())
	ans = 0
	for (j, xx) in enumerate(values):
		if xx ^ x < x:
			x ^= xx
			ans ^= idx[j]
	if x == 0:
		anss = []
		for j in range(i):
			if ans & 1 != 0:
				anss.append(j)
			ans >>= 1
		print(len(anss), *anss)
	else:
		print(0)
		values.append(x)
		idx.append(ans ^ 2 ** i)


import sys, os
numbs = [int(x) for x in sys.stdin.buffer.read().split()]
n = numbs.pop(0)
base = []
out = []
for i in range(n):
	x = numbs[i]
	how = 0
	for (b, rep) in base:
		if x.bit_length() == b.bit_length():
			x ^= b
			how ^= rep
	if x:
		how |= 1 << i
		a = 0
		b = len(base)
		while a < b:
			c = a + b >> 1
			if base[c][0] > x:
				a = c + 1
			else:
				b = c
		base.insert(a, (x, how))
		out.append(0)
	else:
		outind = len(out)
		out.append(-1)
		y = bin(how).encode('ascii')
		ylen = len(y)
		for i in range(2, len(y)):
			if y[i] == 49:
				out.append(ylen - 1 - i)
		out[outind] = len(out) - 1 - outind
os.write(1, b'\n'.join((str(x).encode('ascii') for x in out)))


n = int(input())
t = [0 for i in range(2000)]
c = [0 for i in range(2000)]
for i in range(n):
	x = int(input())
	r = 0
	ok = False
	for j in range(2000):
		if x >> j & 1:
			if t[j] != 0:
				x ^= t[j]
				r ^= c[j]
			else:
				t[j] = x
				c[j] = r ^ 1 << i
				ok = True
				break
	if ok:
		print(0)
		continue
	a = []
	for j in range(2000):
		if r >> j & 1:
			a.append(j)
	print(len(a))
	for y in a:
		print(y)


buck = [[0, 0] for i in range(2201)]
m = int(input())
for i in range(m):
	a = int(input())
	ok = True
	br = 0
	for j in range(2200, -1, -1):
		if a & 1 << j:
			if buck[j][0]:
				a ^= buck[j][0]
				br ^= buck[j][1]
			else:
				ok = False
				buck[j][0] = a
				buck[j][1] = br | 1 << i
				break
	if not ok:
		print('0')
	else:
		lst = []
		for j in range(2201):
			if br & 1 << j:
				lst.append(j)
		print(len(lst), end=' ')
		for j in lst:
			print(j, end=' ')
		print('\n', end='')


n = int(input())
b = []
bb = []
for i in range(n):
	x = int(input())
	idx = 0
	for j in range(len(b)):
		nxt = b[j] ^ x
		if nxt < x:
			x = nxt
			idx ^= bb[j]
	if x == 0:
		cnt = 0
		v = []
		for k in range(2000):
			if idx & 1 << k:
				v.append(k)
		print(len(v), end=' ')
		for e in v:
			print(e, end=' ')
		print()
	else:
		print(0)
		idx ^= 1 << i
		b.append(x)
		bb.append(idx)