Polycarp has n different binary words. A word called binary if it contains only characters '0' and '1'. For example, these words are binary: "0001", "11", "0" and "0011100".

Polycarp wants to offer his set of n binary words to play a game "words". In this game, players name words and each next word (starting from the second) must start with the last character of the previous word. The first word can be any. For example, these sequence of words can be named during the game: "0101", "1", "10", "00", "00001".

Word reversal is the operation of reversing the order of the characters. For example, the word "0111" after the reversal becomes "1110", the word "11010" after the reversal becomes "01011".

Probably, Polycarp has such a set of words that there is no way to put them in the order correspondent to the game rules. In this situation, he wants to reverse some words from his set so that:

  * the final set of n words still contains different words (i.e. all words are unique); 
  * there is a way to put all words of the final set of words in the order so that the final sequence of n words is consistent with the game rules. 



Polycarp wants to reverse minimal number of words. Please, help him.

Input

The first line of the input contains one integer t (1 ≤ t ≤ 10^4) — the number of test cases in the input. Then t test cases follow.

The first line of a test case contains one integer n (1 ≤ n ≤ 2⋅10^5) — the number of words in the Polycarp's set. Next n lines contain these words. All of n words aren't empty and contains only characters '0' and '1'. The sum of word lengths doesn't exceed 4⋅10^6. All words are different.

Guaranteed, that the sum of n for all test cases in the input doesn't exceed 2⋅10^5. Also, guaranteed that the sum of word lengths for all test cases in the input doesn't exceed 4⋅10^6.

Output

Print answer for all of t test cases in the order they appear.

If there is no answer for the test case, print -1. Otherwise, the first line of the output should contain k (0 ≤ k ≤ n) — the minimal number of words in the set which should be reversed. The second line of the output should contain k distinct integers — the indexes of the words in the set which should be reversed. Words are numerated from 1 to n in the order they appear. If k=0 you can skip this line (or you can print an empty line). If there are many answers you can print any of them.

Example

Input


4
4
0001
1000
0011
0111
3
010
101
0
2
00000
00001
4
01
001
0001
00001


Output


1
3 
-1
0

2
1 2 
/*
10 100000
31514 7
43285 4660
39669 3899
60022 838
33584 643
78825 16
824 32
51664 31
15433 476
14295 591

-- 44144
 */
import java.io.*;
import java.util.*;
import java.text.*;
import java.lang.*;
import java.math.*;
 
public class Main{
    static ArrayList[] a=new ArrayList[30];
    static long dp[] = new long [4000001];
    static void pre() {
    	dp[0] = 1L;
    	for(long i = 1 ; i < 4000001 ;i++) {
    		dp[(int) i] = dp[ (int) (i - 1)] * 3L;
    		dp[(int) i] %= mod;
    	}
    }
    static long f(char s[]) {
    	long ans = 0 ;
    	for(int i = 0 ; i < s.length ; i++) {
    		ans += (s[i] - '0') * dp[i];
    		ans %= mod;
    	}
    	ans += ((s.length) * dp[s.length])%mod;
    	ans %= mod;
    	return ans ;
    }
    static long f1(char s[]) {
    	long ans = 0 ;
    	for(int i = 0 ; i < s.length ; i++) {
    		ans += (s[i] - '0') * dp[s.length - 1 -i];
    		ans %= mod;
    	}
    	ans += ((s.length) * dp[s.length])%mod;
    	ans %= mod;
    	return ans ;
    }
     public void solve () throws FileNotFoundException  {
    	InputReader in = new InputReader(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        pre();
        int t = in.nextInt();
        while(t -- >0) {
        	int n = in.nextInt();
        	char s[][] = new char [n][];
        	for(int i = 0 ;i < 4 ;i++) {
        		a[i] = new ArrayList<Integer>();
        	}
        	for(int i = 0 ; i < n ;i++) {
        		s[i] = in.nextLine().toCharArray();
        		if(s[i][0] == '0' ) {
        			if(s[i][s[i].length - 1] == '0') {
        				a[0].add(i);
        			}
        			else
        				a[1].add(i);
        		}
        		else {
        			if(s[i][s[i].length - 1] == '0') {
        				a[2].add(i);
        			}
        			else
        				a[3].add(i);
        		}
        	}
        	if((a[0].size() > 0 && a[3].size() >0) || Math.abs(a[1].size() - a[2].size())> 1) {
        		if(a[0].size() > 0 && a[3].size() >0 && Math.max(a[1].size() , a[2].size()) == 0)
        		{
        			pw.println(-1);
        			continue;
        		}
        		else if(Math.abs(a[1].size() - a[2].size())> 1) {
        			TreeSet<Long>tr = new TreeSet<>();
        			Vector<Integer> v = new Vector<>();
        			if(a[1].size() < a[2].size()) {
        				for(int i = 0 ; i < a[1].size() ; i++) {
        					int idx = (int) a[1].get(i);
        					long got = f(s[idx]);
        					tr.add(got);
        				}
        				for(int i = 0 ; i < a[2].size() ;i++) {
        					int idx = (int) a[2].get(i);
        					long got = f1(s[idx]);
        					if(!tr.contains(got)) {
        						v.add(idx);
        					}
        				}
        				int rem = (a[2].size() - a[1].size() - 1);
        				int can = (rem + 1)/2;
        				pw.println(can);
        				for(int i = 0 ;i < can ;i++) {
        					pw.println((v.get(i)+1)+" ");
        				}
        			}
        			else {
        				for(int i = 0 ; i < a[2].size() ; i++) {
        					int idx = (int) a[2].get(i);
        					long got = f(s[idx]);
        					tr.add(got);
        				}
        				for(int i = 0 ; i < a[1].size() ;i++) {
        					int idx = (int) a[1].get(i);
        					long got = f1(s[idx]);
        					if(!tr.contains(got)) {
        						v.add(idx);
        					}
        				}
        				int rem = (a[1].size() - a[2].size() - 1);
        				int can = (rem + 1)/2;
        				pw.println(can);
        				for(int i = 0 ;i < can ;i++) {
        					pw.print((v.get(i)+1)+" ");
        				}
        			}
        			
        			
        		}
        		else
        			pw.println(0);
        	}
        	else
        		pw.println(0);
        	
        	pw.println();
        	
        }
        pw.flush();
        pw.close();
    }
    public static void main(String[] args) throws Exception {
        
        
        new Thread(null,new Runnable() {
            public void run() {
                    try {
						new Main().solve();
					} catch (FileNotFoundException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
            }
        },"1",1<<26).start();
        
        
    }
   
    static void debug(Object... o) {
        System.out.println(Arrays.deepToString(o));
        }
        
        static class InputReader 
        {
        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;
 
        public InputReader(InputStream stream) 
        {
            this.stream = stream;
        }
        public int snext() 
        {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) 
            {
                curChar = 0;
                try 
                {
                    snumChars = stream.read(buf);
                } 
                catch (IOException e) 
                {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }
 
        public int nextInt() 
        {
            int c = snext();
            while (isSpaceChar(c)) 
            {
                c = snext();
            }
            int sgn = 1;
            if (c == '-')
            {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do 
            {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }
 
        public long nextLong()
        {
            int c = snext();
            while (isSpaceChar(c)) 
            {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') 
            {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do 
            {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }
 
        public int[] nextIntArray(int n) 
        {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) 
            {
                a[i] = nextInt();
            }
            return a;
        }
 
        public String readString()
        {
            int c = snext();
            while (isSpaceChar(c)) 
            {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do 
            {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }
 
        public String nextLine() 
        {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do 
            {
                res.appendCodePoint(c);
                c = snext();
            } while (!isEndOfLine(c));
            return res.toString();
        }
 
        public boolean isSpaceChar(int c) 
        {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
 
        private boolean isEndOfLine(int c) 
        {
            return c == '\n' || c == '\r' || c == -1;
        }
 
        public interface SpaceCharFilter
        {
            public boolean isSpaceChar(int ch);
        }
    }
        public static long mod = 1000000007;
        public static int d;
        public static int p;
        public static int q;
        public void extended(int a,int b) {
            if(b==0) {
                d=a;
                p=1;
                q=0;
            }
            else
            {
                extended(b,a%b);
                int temp=p;
                p=q;
                q=temp-(a/b)*q;
            }
        }
       
        
        public static long binaryExponentiation(long x,long n)
        {
            long result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=result * x;
                x=x*x;
                n=n/2;
            }
            return result;
        }
        
        public static long[] shuffle(long[] a,Random gen)
        {
            int n = a.length;
            for(int i=0;i<n;i++)
            {
                int ind = gen.nextInt(n-i)+i;
                long temp = a[ind];
                a[ind] = a[i];
                a[i] = temp;
            }
            return a;
        }
        
        public static void swap(int a, int b){
            int temp = a;
            a = b;
            b = temp;
        }
        
        public static HashSet<Integer> primeFactorization(int n)
        {
            HashSet<Integer> a =new HashSet<Integer>();
            for(int i=2;i*i<=n;i++)
            {
                while(n%i==0)
                {
                    a.add(i);
                    n/=i;
                }
            }
            if(n!=1)
                a.add(n);
            return a;
        }
        
        public static void sieve(boolean[] isPrime,int n)
        {
            for(int i=1;i<n;i++)
                isPrime[i] = true;
            
            isPrime[0] = false;
            isPrime[1] = false;
            
            for(int i=2;i*i<n;i++)
            {
                if(isPrime[i] == true)
                {
                    for(int j=(2*i);j<n;j+=i)
                        isPrime[j] = false;
                }
            }
        }
        
        public static long GCD(long n,long m)
        {
            if(m==0)
                return n;
            else
                return GCD(m,n%m);
        }
        public static long LCM (long a,long b) {
            return ((a*b)/(GCD(a,b)));
        }
        
        static class pair implements Comparable<pair>
        {
        	Integer x;
        	Integer y;
            
            pair(int x ,int y)
            {
                this.x=x;
                this.y=y;
            }

           
			public int compareTo(pair o) {
                int result = x.compareTo(o.x);
                if(result==0)
                    result = y.compareTo(o.y);
                
                return result;
            }  
            
            public String toString()
            {
                return x+" "+y;
            }
            
            public boolean equals(Object o)
            {
                if (o instanceof pair)
                {
                    pair p = (pair)o;
                    return p.x == x && p.y == y ;
                }
                return false;
            }
            
            public int hashCode()
            {
                return new Double(x).hashCode()*31 + new Long(y).hashCode();
            }
        }
        public static int binaryExponentiation(int x,int n)
        {
            int result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=result * x;
                x=x*x;
                n=n/2;
            }
            return result;
        }
        
       
        
        public static int modularExponentiation(int x,int n,int M)
        {
            int result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=(result * x)%M;
                x=(x%M*x)%M;
                n=n/2;
            }
            return result;
        }
        
        public static long modularExponentiation(long x,long n,long M)
        {
            long result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=(result%M * x%M)%M;
                x=(x%M * x%M)%M;
                n=n/2;
            }
            return result;
        }
        
        public static long modInverse(int A,int M)
        {
            return modularExponentiation(A,M-2,M);
        }
        
        public static long modInverse(long A,long M)
        {
            return modularExponentiation(A,M-2,M);
        }
        
    	            
         
}
