''' from random import randint N = 60 A = set() while len(A) < N: A.add(randint(1, (1<<(N-1))-1)) A = sorted(list(A)) ''' N = int(input()) A = list(map(int,input().split())) N = min(61,N) tmp = 0 for a in A: tmp |= a A2 = [] for i in range(N): A2.append([A[i],[i]]) def f(): tmp = 1 for i in range(N - 1): f = True cmp = -1 for j in range(N): if f: if A2[j][0] & tmp: f = False cmp = A2[j][0] idx = A2[j][1] else: if A2[j][0] & cmp & tmp: A2[j][0] ^= cmp tmp2 = A2[j][1] + idx tmp2.sort() tmp3 = [] n = len(tmp2) i = 0 while i < n: if i < n - 1 and tmp2[i] == tmp2[i+1]: i += 2 else: tmp3.append(tmp2[i]) i += 1 A2[j][1] = tmp3 tmp <<= 1 i = 0 while i < 20 and A2[0][0] > 0: f() A2.sort() i += 1 #print(A) #print(A2[0]) #print("cnt", i) tmp = 0 for i in A2[0][1]: tmp ^= A[i] #print(tmp) #print() if A2[0][0] == 0: print(len(A2[0][1])) print(*[i + 1 for i in A2[0][1]]) else: print(-1)