n = int(input()) a = list(map(int, input().split())) assert 1 <= n <= 2 * 10**5 assert len(a) == n assert all(0 <= x <= 1 << 60 for x in a) if n > 61: n = 61 a = a[:61] idx_list = [{i} for i, _ in enumerate(a)] pivot = 0 for i in range(60): for j in range(pivot, n): if a[j] & (1 << i): a[pivot], a[j] = a[j], a[pivot] idx_list[pivot], idx_list[j] = idx_list[j], idx_list[pivot] break else: continue for j in range(n): if j == pivot: continue if a[j] & (1 << i): a[j] ^= a[pivot] idx_list[j] |= idx_list[pivot] pivot += 1 if 0 in a: zero_idx = a.index(0) b = [i + 1 for i in idx_list[zero_idx]] print(len(b)) print(*b) else: print(-1)