3 2
1 0 1
1 2
2 3
 10 10
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1
6 7
8 3
6 4
4 2
9 2
5 10
9 8
10 7
5 1
6 2

2
1
2
 0

import java.io.*;
import java.util.*;

public class Codeforces841D {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(System.out);
		String[] sp = br.readLine().split(" ");
		int n = 1;//Integer.parseInt(sp[0]);
		int m = 0;//Integer.parseInt(sp[1]);
		sp = br.readLine().split(" ");
		int[] d = new int[n];
		for (int i = 0; i < n; i++) {
			d[i] = Integer.parseInt(sp[i]);
		}
		int[][] edges = new int[m][3];
		/*for (int i = 0; i < m; i++) {
			sp = br.readLine().split(" ");
			int a = Integer.parseInt(sp[0]);
			int b = Integer.parseInt(sp[1]);
			edges[i][0] = Math.min(a, b)-1;
			edges[i][1] = Math.max(a, b)-1;
			edges[i][2] = i;
		}*/
		int[][] adjacency = toadjacency(edges, n);
		int[][] pointer = BFSsearch(adjacency, n, 0);
		boolean negative = false;
		int counter = 0;
		int val = -1;
		for (int i = 0; i < n; i++) {
			if (d[i] == -1) {
				if (!negative) {
					negative = true;
					val = i;
				}
				else {
					d[i] = 0;
				}
			}
			else {
				counter += d[i];
			}
		}
		boolean thing = true;
		if (val == -1) {
			if (counter%2 == 1) {
				pw.println(-1);
				thing = false;
			}
		}
		else {
			d[val] = counter%2;
		}
		if (thing) {
			int[] e = new int[n];
			int[][] edge = new int[m][2];
			int counter2 = 0;
			for (int i = n-1; (i > 0) && (counter2 < m); i--) {
				if (d[pointer[i][0]] != e[pointer[i][0]]) {
					e[pointer[i][0]] = (e[pointer[i][0]]+1)%2;
					e[pointer[i][1]] = (e[pointer[i][1]]+1)%2;
					edge[counter2][0] = Math.min(pointer[i][0], pointer[i][1]);
					edge[counter2][1] = Math.max(pointer[i][0], pointer[i][1]);
					counter2++;
				}
			}

			pw.println(counter2);
			int[][] edges2 = keysort(edges, 1);
			int[][] edges3 = keysort(edges2, 0);
			int[] edges4 = new int[counter2];
			for (int i = 0; i < counter2; i++) {
				edges4[i] = edges3[findIndex(edge[i], edges3)][2];
			}
			Arrays.sort(edges4);
			for (int i = 0; i < counter2; i++) {
				pw.println(edges4[i]+1);
			}
			
		}	

	}
	
	public static int[][] toadjacency(int[][] list, int v) {
		int[] counter = new int[v];
		int n = list.length;
		for (int i = 0; i < n; i++) {
			counter[list[i][0]]++;
			counter[list[i][1]]++;
		}
		int[][] adjacency = new int[v][];
		for (int i = 0; i < v; i++) {
			adjacency[i] = new int[counter[i]];
		}
		int[] counter2 = new int[v];
		for (int i = 0; i < n; i++) {
			adjacency[list[i][0]][counter2[list[i][0]]] = list[i][1];
			counter2[list[i][0]]++;
			adjacency[list[i][1]][counter2[list[i][1]]] = list[i][0];
			counter2[list[i][1]]++;
		}
		
		return adjacency;
	}
	
	public static int[][] BFSsearch (int[][] adjacency, int v, int index) {
		boolean[] found = new boolean[v];
		found[index] = true;
		int[][] indexList = new int[v][2];
		int start = 0;
		int end = 1;
		indexList[0][0] = index;
		indexList[0][1] = index;
		while ((end < v) && (start < end)) {
			for (int i = 0; i < adjacency[indexList[start][0]].length; i++) {
				if (found[adjacency[indexList[start][0]][i]] == false) {
					found[adjacency[indexList[start][0]][i]] = true;
					indexList[end][0] = adjacency[indexList[start][0]][i];
					indexList[end][1] = indexList[start][0];
					end++;
				}
			}
			start++;
		}
		return indexList;
	}
	
	public static int findIndex(int[] n, int[][] list) {
		int r = list.length;
		if ((n[0] > list[r-1][0]) || ((n[0] == list[r-1][0]) && (n[1] > list[r-1][1])))
			return r;
		else {
			int low = 0;
			int high = r-1;
			int val = 0;
			while (low <= high) {
				val = (low+high)/2;
				if ((list[val][0] == n[0]) && (list[val][1] == n[1]))
					return val;
				else if ((list[val][0] > n[0]) || ((list[val][0] == n[0]) && (list[val][1] > n[1])))
					high = val-1;
				else
					low = val+1;
			}
			return low;
		}
	}
	
	public static int[][] keysort(int[][] lst, int key) {
		int n = lst.length;
		if (n == 1) {
			return lst;
		}
		int m = n/2;
		int[][] lst1 = keysort(Arrays.copyOfRange(lst, 0, m), key);
		int[][] lst2 = keysort(Arrays.copyOfRange(lst, m, n), key);
		int[][] lstNew = new int[n][2];
		int counter1 = 0;
		int counter2 = 0;
		while ((counter1 < m) && (counter2 < n-m)) {
			if (lst1[counter1][key] <= lst2[counter2][key]) {
				lstNew[counter1+counter2] = lst1[counter1];
				counter1++;
			}
			else {
				lstNew[counter1+counter2] = lst2[counter2];
				counter2++;
			}
		}
		
		while (counter1 < m) {
			lstNew[counter1+counter2] = lst1[counter1];
			counter1++;
		}
		
		while (counter2 < n-m) {
			lstNew[counter1+counter2] = lst2[counter2];
			counter2++;
		}
		
		return lstNew;
	}

}
