import java.io.*; import java.util.*; import java.util.function.*; import java.util.stream.*; public class Main { static List> visited = new ArrayList<>(); static long[] values; public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int n = Math.min(sc.nextInt(), 100); values = new long[n]; for (int i = 0; i < n; i++) { values[i] = sc.nextLong(); visited.add(new HashSet<>()); } for (int i = n - 1; i >= 0; i--) { List ans = dfw(i - 1, values[i]); if (ans != null) { ans.add(i + 1); System.out.println(ans.size()); System.out.println(ans.stream().map(x -> x.toString()).collect(Collectors.joining(" "))); return; } } System.out.println(-1); } static List dfw(int idx, long v) { if (v == 0) { return new ArrayList<>(); } if (idx < 0) { return null; } if (!visited.get(idx).contains(v)) { visited.get(idx).add(v); List current = dfw(idx - 1, v); if (current != null) { return current; } current = dfw(idx - 1, v ^ values[idx]); if (current != null) { current.add(idx + 1); return current; } } return null; } } class Scanner { BufferedReader br; StringTokenizer st = new StringTokenizer(""); public Scanner() { try { br = new BufferedReader(new InputStreamReader(System.in)); } catch (Exception e) { } } public int nextInt() { return Integer.parseInt(next()); } public long nextLong() { return Long.parseLong(next()); } public double nextDouble() { return Double.parseDouble(next()); } public String next() { try { while (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } } catch (Exception e) { e.printStackTrace(); } finally { return st.nextToken(); } } }