import java.util.Arrays;
import java.util.Scanner;

public class cf545A {
	public static void main(String args[]){
		Scanner in = new Scanner(System.in);
		int n = Integer.parseInt(in.next());
		int a[][] = new int[n][n];
		for(int y = 0; y < n; ++y){
			for(int x = 0; x < n; ++x){
				a[y][x] = Integer.parseInt(in.next());
			}
		}
		int c[][] = new int [n][n];
		for(int i = 0; i < n; ++i){
			Arrays.fill(c[i], 0);
		}
		for(int i = 0; i < n; ++i){
			for(int j = 0; j < n; ++j){
				c[i][i] = 5;
			}
		}
		for(int i = 0; i < n; ++i){
			for(int j = 0; j < n; ++j){
				if(a[i][j] == 1 || a[i][j] == 3){
					c[i][j]++;
				}
			}
		}
		int c2 = 0, c3 = 0;
		int c4[] = new int[n];
		for(int i = 0; i < n; ++i){
			for(int j = 0; j < n; ++j){
				if(c[i][j] == 0 || c[i][j] == 2){
					c3++;
				}
			}
			if(c3 == n - 1){
				c2++;
				c4[i]++;
			}
			c3 = 0;
		}
		System.out.println(c2);
		for(int i = 0; i < n; ++i){
			if(c4[i] == 1){
				System.out.print(i + 1 + " ");
			}
		}
	}
}


package codeforces;

import java.util.Arrays;
import java.util.Scanner;

public class cf545A {
	public static void main(String args[]){
		Scanner in = new Scanner(System.in);
		int n = Integer.parseInt(in.next());
		int a[][] = new int[n][n];
		for(int y = 0; y < n; ++y){
			for(int x = 0; x < n; ++x){
				a[y][x] = Integer.parseInt(in.next());
			}
		}
		int c[][] = new int [n][n];
		for(int i = 0; i < n; ++i){
			Arrays.fill(c[i], 0);
		}
		for(int i = 0; i < n; ++i){
			for(int j = 0; j < n; ++j){
				c[i][i] = 5;
			}
		}
		for(int i = 0; i < n; ++i){
			for(int j = 0; j < n; ++j){
				if(a[i][j] == 1 || a[i][j] == 3){
					c[i][j]++;
				}
			}
		}
		int c2 = 0, c3 = 0;
		int c4[] = new int[n];
		for(int i = 0; i < n; ++i){
			for(int j = 0; j < n; ++j){
				if(c[i][j] == 0 || c[i][j] == 2){
					c3++;
				}
			}
			if(c3 == n - 1){
				c2++;
				c4[i]++;
			}
			c3 = 0;
		}
		System.out.println(c2);
		for(int i = 0; i < n; ++i){
			if(c4[i] == 1){
				System.out.print(i + 1 + " ");
			}
		}
	}
}


package codeforces;

import java.util.Arrays;
import java.util.Scanner;

public class cf545A {

	private static void checkOutput(int a[][]){
		for(int i = 0; i < 3; ++i){
			for(int j = 0; j < 3; ++j){
				System.out.print(a[i][j] + " ");
			}
			System.out.println();
		}
	}

	public static void main(String args[]){
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int a[][] = new int[n][n];
		for(int y = 0; y < n; ++y){
			for(int x = 0; x < n; ++x){
				a[y][x] = in.nextInt();
			}
		}
		int c[][] = new int [n][n];
		for(int i = 0; i < n; ++i){
			Arrays.fill(c[i], 0);
		}
		for(int i = 0; i < n; ++i){
			for(int j = 0; j < n; ++j){
				c[i][i] = -1;
			}
		}
		for(int i = 0; i < n; ++i){
			for(int j = 0; j < n; ++j){
				if(a[i][j] == 1 || a[i][j] == 3){
					c[i][j]++;
				}
			}
		}
		int c2 = 0, c3 = 0;
		int c4[] = new int[n];
		for(int i = 0; i < n; ++i){
			for(int j = 0; j < n; ++j){
				if(c[i][j] == 0 || c[i][j] == 2){
					c3++;
				}
			}
			if(c3 == n - 1){
				c2++;
				c4[i]++;
			}
			c3 = 0;
		}
		System.out.println(c2);
		for(int i = 0; i < n; ++i){
			if(c4[i] == 1){
				System.out.print(i + 1 + " ");
			}
		}
	}
}


import java.util.*;

public class cars {
	public static int upgrade(String s , int k){
		int i = 0;
		String m = "";

		while( i< s.length()  ) {

			if (s.charAt(i)=='3' ||s.charAt(i) =='1')
				return 0 ;
				else i++;

		}
return k+1 ;

	}

    public static void main(String []args) {
    Scanner sc = new Scanner(System.in);
    int x= sc.nextInt();
    String k ="";
    int b =x;
    int ij = 0 ;
    String s = "";
    for (int i =0 ; i<x ; i++){
    	for (int j = 0 ; j <x ;j++){
    		 ij = sc.nextInt();
    		 if (ij==-1)
    		   s = s+"" ;
    		   else s=s+ij;

    		 if (ij == 1 ||ij==3 )
    		 b--;
		}
		int as = upgrade(s,i);

		if ( as== 0)
	k = k + "";	else k = k +as+" " ;
	s= "";

    }
    if( k.length() ==1)
System.out.println(k.length());
else
System.out.println(k.length()/2);
System.out.println(k);
}
}


import java.util.*;

public class cars {
	public static int upgrade(String s , int k){
		int i = 0;
		String m = "";

		while( i< s.length()  ) {

			if (s.charAt(i)=='3' ||s.charAt(i) =='1')
				return 0 ;
				else i++;

		}
return k+1 ;

	}

    public static void main(String []args) {
    Scanner sc = new Scanner(System.in);
    int x= sc.nextInt();
    String k ="";
    int h= x ;
    	boolean b = true ;
    int ij = 0 ;
    String s = "";
    for (int i =0 ; i<x ; i++){
    	for (int j = 0 ; j <x ;j++){
    		 ij = sc.nextInt();
    		 if (ij==-1)
    		   s = s+"" ;
    		   else s=s+ij;

    		 if (ij == 1 ||ij==3 )
    		 b= false;
		}
		if
		 (b ==false) h--;
		 b=true;
		int as = upgrade(s,i);
		if ( as== 0)
	k = k + "";	else k = k +as+" " ;
	s= "";

    }

System.out.println(h);
System.out.println(k);
}
}


import java.io.PrintWriter;
import java.util.*;
import java.util.Arrays;
import java.util.Scanner;
public class Ruff
{
    public static void main(String args[])
    {
        Scanner vicky=new Scanner(System.in);
        int n=vicky.nextInt();
        int [][]ar=new int[n+1][n+1];
        for(int i=0;i<n;i++)
        {
            for(int j=0;j<n;j++)
                ar[i+1][j+1]=vicky.nextInt();
        }
        int count=0;
        int []ans=new int [n];
        for(int i=0;i<n;i++)
        {
            for(int j=0;j<n;j++)
            {
                if(ar[i+1][j+1]==1||ar[i+1][j+1]==3)
                {
                    ans[count]=i+1;
                    count++;
                    break;
                }
            }
        }
        System.out.println(count);
        for(int i=0;i<n;i++)
        {
            if(ans[i]==0)
                break;
            else
                System.out.print(ans[i]+" ");

        }
    }
}


import java.io.PrintWriter;
import java.util.*;
import java.util.Arrays;
import java.util.Scanner;
public class Ruff
{
    public static void main(String args[])
    {
        Scanner vicky=new Scanner(System.in);
        int n=vicky.nextInt();
        int [][]ar=new int[n+1][n+1];
        for(int i=0;i<n;i++)
        {
            for(int j=0;j<n;j++)
                ar[i+1][j+1]=vicky.nextInt();
        }
        int count=0;
        int []ans=new int [n+1];
        for(int i=0;i<n;i++)
        {
            for(int j=0;j<n;j++)
            {
                if(ar[i+1][j+1]==1||ar[i+1][j+1]==3)
                {
                    ans[i+1]=-1;
                    count++;
                    break;
                }
            }
        }
        System.out.println(n-count);
        for(int i=1;i<=n;i++)
        {
            if(ans[i]!=-1)
                System.out.print(i+" ");
        }
    }
}


import java.util.Arrays;
import java.util.Scanner;
public class apples {
public static void main(String args[]){
	Scanner input = new Scanner(System.in);
    int n = input.nextInt();
    int a[][]=new int[n][n];
    int b[]=new int[n];int k=0;
    for(int i=0;i<n;i++){
    	for(int j=0;j<n;j++){
    		a[i][j] = input.nextInt();
    	}
    }
    for(int i=0;i<n;i++){
    	int f=0;
    	for(int j=0;j<n;j++){
    		if(a[i][j]==1||a[i][j]==3 ){
    			f=1;
    		break;}
    	}
    	if(f!=1){
    		b[k]=i+1;
    		k++;
    	}
    }
	Arrays.sort(b);
	System.out.println(k);
	for(int c:  b){
		if(c!=0)
		System.out.print(c+"");}
}
}


import java.util.Arrays;
import java.util.Scanner;
public class apples {
public static void main(String args[]){
	Scanner input = new Scanner(System.in);
    int n = input.nextInt();
    int a[][]=new int[n][n];
    int b[]=new int[n];int k=0;
    for(int i=0;i<n;i++){
    	for(int j=0;j<n;j++){
    		a[i][j] = input.nextInt();
    	}
    }
    for(int i=0;i<n;i++){
    	int f=0;
    	for(int j=0;j<n;j++){
    		if(a[i][j]==1||a[i][j]==3 ){
    			f=1;
    		break;}
    	}
    	if(f!=1){
    		b[k]=i+1;
    		k++;
    	}
    }
	Arrays.sort(b);
	System.out.println(k);
	for(int c:  b){
		if(c!=0)
		System.out.print(c+" ");}
}
}


import java.util.*;
import static java.lang.System.out;
import static java.lang.Math.*;

public class T {
	public static void main(String... args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();

		List<Integer> al = new ArrayList<>();
		int x;
		for (int i = 0; i < n; ++i) {
			boolean ok = true;
			for (int j = 0; j < n; ++j) {
				x = in.nextInt();
				if (x == 1 || x == 3) {
					ok = false;
					break;
				}
			}
			if (ok) {
				al.add(i);
			}
		}
		out.println(al.size());
		for (int y : al) {
			out.print(y+1);
			out.print(" ");
		}
	}
}


import java.util.*;
import static java.lang.System.out;
import static java.lang.Math.*;

public class T {
	public static void main(String... args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();

		List<Integer> al = new ArrayList<>();
		int x;
		for (int i = 0; i < n; ++i) {
			boolean ok = true;
			for (int j = 0; j < n; ++j) {
				x = in.nextInt();
				if (x == 1 || x == 3) {
					ok = false;
				}
			}
			if (ok) {
				al.add(i);
			}
		}
		out.println(al.size());
		for (int y : al) {
			out.print(y+1);
			out.print(" ");
		}
	}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Pradyumn
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, FastReader in, PrintWriter out) {
            int n = in.nextInt();
            int[][] a = in.nextIntMap(n, n);
            int p = 0;
            int[] ans = new int[n];
            for (int i = 0; i < n; ++i) {
                boolean f = true;
                for (int j = 0; j < n; ++j) {
                    f &= a[i][j] == -1 || a[i][j] == 0 || a[i][j] == 2;
                }
                if (f) ans[p++] = i + 1;
            }
            out.println(p);
            ArrayUtils.printArray(out, Arrays.copyOf(ans, p));
        }

    }

    static class ArrayUtils {
        public static void printArray(PrintWriter out, int[] array) {
            if (array.length == 0) return;
            for (int i = 0; i < array.length; i++) {
                if (i != 0) out.print(" ");
                out.print(array[i]);
            }
            out.println();
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar;
        private int pnumChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        private int pread() {
            if (pnumChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= pnumChars) {
                curChar = 0;
                try {
                    pnumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (pnumChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = pread();
            while (isSpaceChar(c))
                c = pread();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = pread();
            }
            int res = 0;
            do {
                if (c == ',') {
                    c = pread();
                }
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = pread();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int[] array = new int[n];
            for (int i = 0; i < n; i++) {
                array[i] = nextInt();
            }
            return array;
        }

        public int[][] nextIntMap(int n, int m) {
            int[][] array = new int[n][];
            for (int i = 0; i < n; i++) {
                array[i] = nextIntArray(m);
            }
            return array;
        }

        private boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        private static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Pradyumn
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, FastReader in, PrintWriter out) {
            int n = in.nextInt();
            int[][] a = in.nextIntMap(n, n);
            int p = 0;
            int[] ans = new int[n];
            for (int i = 0; i < n; ++i) {
                boolean f = true;
                for (int j = 0; j < n; ++j) {
                    f &= a[i][j] == -1 || a[i][j] == 0 || a[i][j] == 2;
                }
                if (f) ans[p++] = i + 1;
            }
            out.println(p);
            ArrayUtils.printArray(out, Arrays.copyOf(ans, p));
        }

    }

    static class ArrayUtils {
        public static void printArray(PrintWriter out, int[] array) {
            for (int i = 0; i < array.length; i++) {
                if (i != 0) out.print(" ");
                out.print(array[i]);
            }
            out.println();
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar;
        private int pnumChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        private int pread() {
            if (pnumChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= pnumChars) {
                curChar = 0;
                try {
                    pnumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (pnumChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = pread();
            while (isSpaceChar(c))
                c = pread();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = pread();
            }
            int res = 0;
            do {
                if (c == ',') {
                    c = pread();
                }
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = pread();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int[] array = new int[n];
            for (int i = 0; i < n; i++) {
                array[i] = nextInt();
            }
            return array;
        }

        public int[][] nextIntMap(int n, int m) {
            int[][] array = new int[n][];
            for (int i = 0; i < n; i++) {
                array[i] = nextIntArray(m);
            }
            return array;
        }

        private boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        private static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.StringTokenizer;
import java.util.Set;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author a1M
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            if (n == 1) {
                out.println(1);
                out.print(1);
            } else {
                int[] a = new int[n];
                Set<Integer> set = new HashSet<Integer>();
                int length = n - 1;
                for (int i = 0; i < n; i++) {
                    a[i] = in.nextInt();
                }

                for (int i = 0; i < length; i++) {
                    for (int j = 0; j < n; j++) {
                        int num = in.nextInt();
                        if (num == 0 || num == 1) {
                            set.add(j + 1);
                        }
                    }
                }
                out.println(set.size());
                for (Integer i : set) {
                    out.print(i + " ");
                }
            }
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author a1M
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int[] a = new int[n];
            ArrayList<Integer> arr = new ArrayList<Integer>();

            for (int i = 1; i <= n; i++) {
                boolean check = true;
                for (int j = 0; j < n; j++) {
                    int num = in.nextInt();
                    if (num == 1 || num == 3) {
                        check = false;
                    }
                }
                if (check) arr.add(i);
            }
            out.println(arr.size());
            for (Integer i : arr) {
                out.print(i + " ");
            }
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.StringTokenizer;
import java.util.Set;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author a1M
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int[] a = new int[n];
            Set<Integer> set = new HashSet<Integer>();

            for (int i = 1; i <= n; i++) {
                boolean check = true;
                for (int j = 0; j < n; j++) {
                    int num = in.nextInt();
                    if (num == 1 || num == 3) {
                        check = false;
                    }
                }
                if (check) set.add(i);
            }
            out.println(set.size());
            for (Integer i : set) {
                out.print(i + " ");
            }
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.StringTokenizer;
import java.util.Set;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author a1M
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int[] a = new int[n];
            Set<Integer> set = new HashSet<Integer>();
            int length = n - 1;
            for (int i = 0; i < n; i++) {
                a[i] = in.nextInt();
            }

            for (int i = 0; i < length; i++) {
                for (int j = 0; j < n; j++) {
                    int num = in.nextInt();
                    if (num == 0 || num == 1) {
                        set.add(j + 1);
                    }
                }
            }
            out.println(set.size());
            for (Integer i : set) {
                out.print(i + " ");
            }
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}


import java.util.Arrays;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.InputStream;
import java.util.NoSuchElementException;
import java.io.OutputStreamWriter;
import java.math.BigInteger;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.io.IOException;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskA {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
        int n = in.nextInt();
        int[][] matrix = new int[n][n];
        for (int i = 0; i < n; i++) {
            matrix[i] = IOUtils.readIntArray(in, n);
        }
        if(n==1){
            out.println("1");
            out.print("1");
            return;
        }
        int[] ans = new int[n];
        Arrays.fill(ans, Integer.MIN_VALUE);
        for (int i = 0; i < n; i++) {

            for (int j = 0; j < n; j++) {
                if (i != j) {
                    if (matrix[i][j] == 0) {
                        ans[i] = 99;
                        ans[j] = 99;
                    } else if (matrix[i][j] == 1) {
                        ans[i] = 9;
                    } else if (matrix[i][j] == 2) ans[j] = 9;
                    else if (matrix[i][j] == 3) {
                        ans[i] = 9;
                        ans[j] = 9;
                    }
                }
            }
        }
        int kk = 0;
        StringBuffer sb = new StringBuffer();
        for (int k = 0; k < ans.length; k++) {
            if (ans[k] == 99) {
                kk++;
                sb.append(k + 1);
                sb.append(" ");
            }
        }
        out.println(kk);
        out.print(sb.toString());

    }
}

class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return isWhitespace(c);
    }

    public static boolean isWhitespace(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
}

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public void print(Object...objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }

    public void println(Object...objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

    public void println(int i) {
        writer.println(i);
    }
}

class IOUtils {

    public static int[] readIntArray(InputReader in, int size) {
        int[] array = new int[size];
        for (int i = 0; i < size; i++)
            array[i] = in.nextInt();
        return array;
    }

}


import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.util.ArrayList;
import java.io.InputStream;
import java.util.NoSuchElementException;
import java.io.OutputStreamWriter;
import java.math.BigInteger;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.io.IOException;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskA {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
        int n = in.nextInt();
        ArrayList<Integer>list=new ArrayList<Integer>();
        outer:
        for (int i = 0; i < n; i++) {
            int[] x = IOUtils.readIntArray(in, n);
            for (int xx : x) {
                if (xx == 1 || xx == 3) continue outer;
            }
            list.add(i+1);
        }
        out.println(list.size());
        out.println(list);

    }
}

class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return isWhitespace(c);
    }

    public static boolean isWhitespace(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
}

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public void print(Object...objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }

    public void println(Object...objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

    public void println(int i) {
        writer.println(i);
    }
}

class IOUtils {

    public static int[] readIntArray(InputReader in, int size) {
        int[] array = new int[size];
        for (int i = 0; i < size; i++)
            array[i] = in.nextInt();
        return array;
    }

}


import java.util.Arrays;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.InputStream;
import java.util.NoSuchElementException;
import java.io.OutputStreamWriter;
import java.math.BigInteger;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.io.IOException;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskA {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
    int n=in.nextInt();
        int [][]matrix=new int [n][n];
        for(int i=0;i<n;i++){
            matrix[i]= IOUtils.readIntArray(in,n);
        }
        int []ans=new int [n];
        Arrays.fill(ans,Integer.MIN_VALUE);
        for(int i=0;i<n;i++){
            for(int j=i+1;j<n;j++){
                if(matrix[i][j]==0){
                    ans[i]=99;ans[j]=99;
                }
                else if (matrix[i][j]==1){
                    ans[i]=9;
                }
                else if (matrix[i][j]==2)ans[j]=9;
                else if (matrix[i][j]==3){
                    ans[i]=9;ans[j]=9;
                }
            }
        }
        int kk=0;
        StringBuffer sb=new StringBuffer();
        for(int k=0;k<ans.length;k++){
            if(ans[k]==99){
                kk++;
                sb.append(k+1);sb.append(" ");
            }
        }
        out.println(kk);
        out.print(sb.toString());

    }
}

class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return isWhitespace(c);
    }

    public static boolean isWhitespace(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
}

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public void print(Object...objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }

    public void close() {
        writer.close();
    }

    public void println(int i) {
        writer.println(i);
    }
}

class IOUtils {

    public static int[] readIntArray(InputReader in, int size) {
        int[] array = new int[size];
        for (int i = 0; i < size; i++)
            array[i] = in.nextInt();
        return array;
    }

}


import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.util.ArrayList;
import java.io.InputStream;
import java.util.NoSuchElementException;
import java.io.OutputStreamWriter;
import java.math.BigInteger;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.io.IOException;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskA {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
        int n = in.nextInt();
        ArrayList<Integer>list=new ArrayList<Integer>();
        outer:
        for (int i = 0; i < n; i++) {
            int[] x = IOUtils.readIntArray(in, n);
            for (int xx : x) {
                if (xx == 1 || xx == 3) continue outer;
            }
            list.add(i+1);
        }
        out.println(list.size());
        for(int x:list){
            out.print(x+" ");
        }

    }
}

class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return isWhitespace(c);
    }

    public static boolean isWhitespace(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
}

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public void print(Object...objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }

    public void close() {
        writer.close();
    }

    public void println(int i) {
        writer.println(i);
    }
}

class IOUtils {

    public static int[] readIntArray(InputReader in, int size) {
        int[] array = new int[size];
        for (int i = 0; i < size; i++)
            array[i] = in.nextInt();
        return array;
    }

}


import java.util.Arrays;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.InputStream;
import java.util.NoSuchElementException;
import java.io.OutputStreamWriter;
import java.math.BigInteger;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.io.IOException;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskA {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
        int n = in.nextInt();
        int[][] matrix = new int[n][n];
        for (int i = 0; i < n; i++) {
            matrix[i] = IOUtils.readIntArray(in, n);
        }
        if(n==1){
            out.println("1");
            out.print("1");
            return;
        }
        int[] ans = new int[n];
        Arrays.fill(ans,99 );
        for (int i = 0; i < n; i++) {

            for (int j = 0; j < n; j++) {
                if (i != j) {
                    if (matrix[i][j] == 0) {
                        ans[i] = 99;
                        ans[j] = 99;
                    } else if (matrix[i][j] == 1) {
                        ans[i] = 9;
                    } else if (matrix[i][j] == 2) ans[j] = 9;
                    else if (matrix[i][j] == 3) {
                        ans[i] = 9;
                        ans[j] = 9;
                    }
                }
            }
            }
        int kk = 0;
        StringBuffer sb = new StringBuffer();
        for (int k = 0; k < ans.length; k++) {
            if (ans[k] == 99) {
                kk++;
                sb.append(k + 1);
                sb.append(" ");
            }
        }
        out.println(kk);
        out.print(sb.toString());

    }
}

class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return isWhitespace(c);
    }

    public static boolean isWhitespace(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
}

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public void print(Object...objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }

    public void println(Object...objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

    public void println(int i) {
        writer.println(i);
    }
}

class IOUtils {

    public static int[] readIntArray(InputReader in, int size) {
        int[] array = new int[size];
        for (int i = 0; i < size; i++)
            array[i] = in.nextInt();
        return array;
    }

}


import java.util.*;
public class Lab{
	public static void main (String [] args){
		Scanner s=new Scanner(System.in);
		int n=s.nextInt();
		boolean o=true;
		String q="";
		int p=0;
		for(int i=1;i<=n;i++){
		 for(int k=1;k<=n;k++){
		 	int z=s.nextInt();
		 	if(z==1||z==3) o=false;
		 }
		 if(o) {q=q+i+" ";p++;}
		 o=true;
		}
		System.out.println(p);
		System.out.println(q);}}


	/*	/ ﾌﾌ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ム
		/ )\⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀  Y
		(⠀⠀| ( ͡° ͜ʖ ͡°）⠀⌒(⠀ ノ
		(⠀ ﾉ⌒ Y ⌒ヽ-く __／
		| _⠀｡ノ| ノ｡ |/
		(⠀ー '_人`ー ﾉ
		⠀|\ ￣ _人'彡ﾉ
		⠀ )\⠀⠀ ｡⠀⠀ /
		⠀⠀(\⠀ #⠀ /
		⠀/⠀⠀⠀/ὣ====================D-
		/⠀⠀⠀/⠀ \ \⠀⠀\
		( (⠀)⠀⠀⠀⠀ ) ).⠀)
		(⠀⠀)⠀⠀⠀⠀⠀( | /
		|⠀ /⠀⠀⠀⠀⠀⠀ | /
		[_] ⠀⠀⠀⠀⠀[___]                     */
	// Main Code at the Bottom
	import java.util.*;
	import java.lang.*;
	import java.io.*;
	import java.math.BigInteger;
	public class Main {
		//Fast IO class
	    static class FastReader {
	        BufferedReader br;
	        StringTokenizer st;
	        public FastReader() {
	        	boolean env=System.getProperty("ONLINE_JUDGE") != null;
	        	if(!env) {
	        		try {
						br=new BufferedReader(new FileReader("src\\input.txt"));
					} catch (FileNotFoundException e) {
						e.printStackTrace();
					}
	        	}
	        	else br = new BufferedReader(new InputStreamReader(System.in));
	        }
	        String next() {
	            while (st == null || !st.hasMoreElements()) {
	                try {
	                    st = new StringTokenizer(br.readLine());
	                }
	                catch (IOException  e) {
	                    e.printStackTrace();
	                }
	            }
	            return st.nextToken();
	        }
	        int nextInt() {
	            return Integer.parseInt(next());
	        }
	        long nextLong() {
	            return Long.parseLong(next());
	        }
	        double nextDouble() {
	            return Double.parseDouble(next());
	        }
	        String nextLine() {
	            String str = "";
	            try {
	                str = br.readLine();
	            }
	            catch (IOException e) {
	                e.printStackTrace();
	            }
	            return str;
	        }
	    }
	    static long MOD=1000000000+7;
	    //Euclidean Algorithm
	    static long gcd(long A,long B){
	    	return (B==0)?A:gcd(B,A%B);
	    }
	    //Modular Exponentiation
	    static long fastExpo(long x,long n){
	        if(n==0) return 1;
	        if((n&1)==0) return fastExpo((x*x)%MOD,n/2)%MOD;
	        return ((x%MOD)*fastExpo((x*x)%MOD,(n-1)/2))%MOD;
	    }
	    //Modular Inverse
	    static long inverse(long x) {
	    	return fastExpo(x,MOD-2);
	    }
	    //Prime Number Algorithm
	    static boolean isPrime(long n){
	        if(n<=1) return false;
	        if(n<=3) return true;
	        if(n%2==0 || n%3==0) return false;
	        for(int i=5;i*i<=n;i+=6) if(n%i==0 || n%(i+2)==0) return false;
	        return true;
	    }
	    //Reverse an array
	    static void reverse(char arr[],int l,int r){
	    	while(l<r) {
	    		char tmp=arr[l];
	    		arr[l++]=arr[r];
	    		arr[r--]=tmp;
	    	}
	    }
	    //Print array
	    static void print1d(int arr[]) {
	    	out.println(Arrays.toString(arr));
	    }
	    static void print2d(int arr[][]) {
	    	for(int a[]: arr) out.println(Arrays.toString(a));
	    }
	    // Pair
	    static class pair{
	    	int x,y;
	    	pair(int a,int b){
	    		this.x=a;
	    		this.y=b;
	    	}
	    	public boolean equals(Object obj) {
	    		if(obj == null || obj.getClass()!= this.getClass()) return false;
	            pair p = (pair) obj;
	            return (this.x==p.x && this.y==p.y);
	        }
	    	public int hashCode() {
	            return Objects.hash(x,y);
	        }
	    }
	    static FastReader sc=new FastReader();
	    static PrintWriter out=new PrintWriter(System.out);
	    //Main function(The main code starts from here
	    public static void main (String[] args) throws java.lang.Exception {
	    	int test=1;
	    	//test=sc.nextInt();
	    	while(test-->0){
	    		int n=sc.nextInt(),a[][]=new int[n][n];
	    		for(int i=0;i<n;i++) {
	    			for(int j=0;j<n;j++) a[i][j]=sc.nextInt();
	    		}
	    		int ans=0;
	    		ArrayList<Integer> arr=new ArrayList<>();
	    		for(int i=0;i<n;i++) {
	    			int f=1;
	    			for(int j=0;j<n;j++) {
	    				if(a[i][j]>0 && a[i][j]!=2) f=0;
	    			}
	    			ans+=f;
	    			if(f==1) arr.add(i+1);
	    		}
	    		out.println(ans);
	    		for(Integer x: arr) out.print(x+" ");
	    		out.println();
	    	}
	        out.flush();
	        out.close();
	    }
	}


import java.io.*;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class A {
    public static void main(String[] args) {
        FastScanner in;
        PrintWriter out;

        in = new FastScanner(System.in);
        out = new PrintWriter(System.out);

        final ArrayList<Integer> ans = new ArrayList<>();
        final int n = in.nextInt();
        loop: for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                final int d = in.nextInt();
                if (d == 1 || d == 3) continue loop;
            }
            ans.add(i+1);
        }

        out.println(ans.size());
        for (Integer an : ans) {
            out.print(an + " ");
        }

        out.close();
    }

    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public FastScanner(InputStream f) {
            br = new BufferedReader(new InputStreamReader(f));
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return null;
                st = new StringTokenizer(s);
            }
            return st.nextToken();
        }

        boolean hasMoreTokens() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return false;
                st = new StringTokenizer(s);
            }
            return true;
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}


import java.io.*;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.StringTokenizer;

public class A {
    public static void main(String[] args) {
        FastScanner in;
        PrintWriter out;

        in = new FastScanner(System.in);
        out = new PrintWriter(System.out);

        final ArrayList<Integer> ans = new ArrayList<>();
        final int n = in.nextInt();
        loop: for (int i = 0; i < n; i++) {
            boolean lol = false;
            for (int j = 0; j < n; j++) {
                final int d = in.nextInt();
                if (d == 1 || d == 3) lol = true;
            }
            if (!lol)
                ans.add(i+1);
        }

        out.println(ans.size());
        for (Integer an : ans) {
            out.print(an + " ");
        }

        out.close();
    }

    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public FastScanner(InputStream f) {
            br = new BufferedReader(new InputStreamReader(f));
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return null;
                st = new StringTokenizer(s);
            }
            return st.nextToken();
        }

        boolean hasMoreTokens() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return false;
                st = new StringTokenizer(s);
            }
            return true;
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Random;
import java.util.StringTokenizer;

public class Main {

	static int MOD = 1000 * 1000 * 1000 + 7;

	public static void shuffleArray(int[] arr) {
		int n = arr.length;
		Random rnd = new Random();
		for (int i = 0; i < n; ++i) {
			int tmp = arr[i];
			int randomPos = i + rnd.nextInt(n - i);
			arr[i] = arr[randomPos];
			arr[randomPos] = tmp;
		}
	}

	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		solve(in, out);
		out.close();
		System.exit(0);
	}

	class Deck implements Comparable<Deck> {
		LinkedList<Integer> list;

		Deck(LinkedList<Integer> o) {
			this.list = new LinkedList<>();
			for (int e : o) {
				this.list.add(e);
			}
		}

		@Override
		public int compareTo(Deck o) {
			if (o.list.size() != list.size()) {
				return Integer.compare(list.size(), o.list.size());
			}
			Iterator<Integer> it = list.iterator();
			Iterator<Integer> it2 = o.list.iterator();
			while (it.hasNext()) {
				int e = it.next();
				int e2 = it2.next();
				if (e < e2) {
					return -1;
				}
				if (e > e2) {
					return 1;
				}
			}
			return 0;
		}

	}

	private static void solve(InputReader in, PrintWriter out) {
		int n = in.nextInt();
		int[][] tab = new int[n][n];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				tab[i][j] = in.nextInt();
			}
		}
		ArrayList<Integer> good = new ArrayList<>();
		for (int i = 0; i < n; i++) {
			int count = 0;
			for (int j = 0; j < n; j++) {
				if (tab[i][j] == 0 || tab[i][j] == 2) {
					count++;
				}
			}
			if (count == n - 1) {
				good.add(i);
			}
		}
		out.println(good.size());
		for (int e : good) {
			out.print((e + 1) + " ");
		}
	}

	/*
	 *
	 */
	// --------------------------------------------------------
	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public String nextLine() {
			String str = "";
			try {
				str = reader.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}

			return str;
		}
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Random;
import java.util.StringTokenizer;

public class Main {

	static int MOD = 1000 * 1000 * 1000 + 7;

	public static void shuffleArray(int[] arr) {
		int n = arr.length;
		Random rnd = new Random();
		for (int i = 0; i < n; ++i) {
			int tmp = arr[i];
			int randomPos = i + rnd.nextInt(n - i);
			arr[i] = arr[randomPos];
			arr[randomPos] = tmp;
		}
	}

	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		solve(in, out);
		out.close();
		System.exit(0);
	}

	class Deck implements Comparable<Deck> {
		LinkedList<Integer> list;

		Deck(LinkedList<Integer> o) {
			this.list = new LinkedList<>();
			for (int e : o) {
				this.list.add(e);
			}
		}

		@Override
		public int compareTo(Deck o) {
			if (o.list.size() != list.size()) {
				return Integer.compare(list.size(), o.list.size());
			}
			Iterator<Integer> it = list.iterator();
			Iterator<Integer> it2 = o.list.iterator();
			while (it.hasNext()) {
				int e = it.next();
				int e2 = it2.next();
				if (e < e2) {
					return -1;
				}
				if (e > e2) {
					return 1;
				}
			}
			return 0;
		}

	}

	private static void solve(InputReader in, PrintWriter out) {
		int n = in.nextInt();
		int[][] tab = new int[n][n];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				tab[i][j] = in.nextInt();
			}
		}
		ArrayList<Integer> good = new ArrayList<>();
		for (int i = 0; i < n; i++) {
			boolean isOk = true;
			for (int j = 0; j < n; j++) {
				isOk &= (tab[i][j] != 1) && (tab[i][j] != 3);
			}
			if (isOk) {
				good.add(i + 1);
			}
		}
		out.println(good.size());
		for (int e : good) {
			out.print(e + " ");
		}
	}

	/*
	 *
	 */
	// --------------------------------------------------------
	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public String nextLine() {
			String str = "";
			try {
				str = reader.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}

			return str;
		}
	}

}


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

public class Main {

    private static StringBuilder data = new StringBuilder();
    private final static FastReader in = new FastReader();

    public static void main(String[] args) {
        int n = in.inT(), g = 0,t;

        boolean good;
        for (int i = 0; i < n; i++) {
            good=true;
            for (int j = 0; j < n; j++) {
                t=in.inT();
                if(t==1||t==3){
                    good=false;
                }
            }
            if(good){
                g++;
               data.append(i+1).append(" ");
            }
        }

        System.out.println(g);
        System.out.println(data);

    }

    static void fileOut(String s) {
        File out = new File("output.txt");
        try {
            FileWriter fw = new FileWriter(out);
            fw.write(s);
            fw.flush();
            fw.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        public FastReader(String path) {
            try {
                br = new BufferedReader(new
                        InputStreamReader(new FileInputStream(path)));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int inT() {
            return Integer.parseInt(next());
        }

        long lonG() {
            return Long.parseLong(next());
        }

        float floaT() {
            return Float.parseFloat(next());
        }

        double doublE() {
            return Double.parseDouble(next());
        }

        String line() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

}


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

public class Main {

    private static StringBuilder data = new StringBuilder();
    private final static FastReader in = new FastReader();

    public static void main(String[] args) {
        int n = in.inT(), g = 0;
        int[][]a = new int[n][n];
        int []b = new int[n];
        boolean good;
        for (int i = 0; i < n; i++) {
            good=true;
            for (int j = 0; j < n; j++) {
                a[i][j]=in.inT();
                if(a[i][j]==1||a[i][j]==3){
                    good=false;
                }
            }
            if(good){
                b[i]++;
            }else{
                b[i]=0;
            }
        }
        for (int i = 0; i < n; i++) {
            if(b[i]>0){
                g++;
                data.append(i+1).append(" ");
            }
        }
        System.out.println(g);
        System.out.println(data);

    }

    static void fileOut(String s) {
        File out = new File("output.txt");
        try {
            FileWriter fw = new FileWriter(out);
            fw.write(s);
            fw.flush();
            fw.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        public FastReader(String path) {
            try {
                br = new BufferedReader(new
                        InputStreamReader(new FileInputStream(path)));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int inT() {
            return Integer.parseInt(next());
        }

        long lonG() {
            return Long.parseLong(next());
        }

        float floaT() {
            return Float.parseFloat(next());
        }

        double doublE() {
            return Double.parseDouble(next());
        }

        String line() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

}


import java.util.*;
public class ToyCars {

    public static void main(String[] args) {
         Scanner sc = new Scanner(System.in);
         int n=sc.nextInt();
         ArrayList<Integer> arr = new ArrayList<Integer>();
         for(int i=0;i<n;i++)
         {
             boolean good=true;
             for(int j=0;j<n;j++)
             {
                 int c=sc.nextInt();
                 if(c>0 && c%2==1)
                     {
                        good=false;
                        break;
                     }
             }
             if(good)arr.add(i+1);
         }
         System.out.println(arr.size());
         for(int val : arr)
         {
             System.out.print(val+ " ");
         }
    }

}


import java.util.*;
public class ToyCars {

    public static void main(String[] args) {
         Scanner sc = new Scanner(System.in);
         int n=sc.nextInt();
         ArrayList<Integer> arr = new ArrayList<Integer>();
         for(int i=0;i<n;i++)
         {
             boolean good=true;
             for(int j=0;j<n;j++)
             {
                 int c=sc.nextInt();
                 if(c>0 && c%2==1)
                     {
                        good=false;
                     }
             }
             if(good)arr.add(i+1);
         }
         System.out.println(arr.size());
         for(int val : arr)
         {
             System.out.print(val+ " ");
         }
    }

}


import java.util.*;
public class ToyCars {

    public static void main(String[] args) {
         Scanner sc = new Scanner(System.in);
         int n=sc.nextInt();
         ArrayList<Integer> arr = new ArrayList<Integer>();
         for(int i=0;i<n;i++)
         {
             boolean good=true;
             for(int j=0;j<n;j++)
             {
                 int c=sc.nextInt();
                 if(c>=0 && c%2==1)
                     {
                        good=false;
                        break;
                     }
             }
             if(good)arr.add(i+1);
         }
         System.out.println(arr.size());
         for(int val : arr)
         {
             System.out.print(val+ " ");
         }
    }

}


import java.util.Arrays;
import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author Dell
 */
public class NewMain45 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int good = 0;
        String qq = "";
        int[] z = new int[n+1];
        s.nextLine();
        for (int i = 0; i < n; i++) {
            int count = 0;

            String f = s.nextLine();

            String[] zx = f.split(" ");

            for (String zx1 : zx) {
                if (zx1.equals("3") || zx1.equals("1")) {
                    count++;
                }
            }

            z[i+1] = count;

        }
        //System.out.println(Arrays.toString(z));
        for (int i = 1; i <= n; i++) {
            if (z[i] == 0) {
                good++;
                qq += (i) + " ";
            }
        }
        if (good > 0) {
            qq = "\n" + qq;
        }
        System.out.println(good + qq);
    }

}


import java.util.Arrays;
import java.util.Scanner;

public class NewMain45 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int good = 0;
        String qq = "";
        int[] z = new int[n];
        s.nextLine();
        for (int i = 0; i < n; i++) {
            int count = 0;

            String f = s.nextLine();

            String[] zx = f.split(" ");

            for (String zx1 : zx) {
                if (zx1.equals("3") || zx1.equals("1")) {
                    count++;
                }
            }

            z[i] = count;

        }

        for (int i = 0; i < n; i++) {
            if (z[i] == 0) {
                good++;
                qq += (++i) + " ";
            }
        }

        if (good > 0) {
            qq = "\n" + qq;
        }

        System.out.println(good + qq);
    }

}


import java.util.Scanner;
public class contest
{
	public static void main(String[] args)
 	{
			int carnum=0;
			Scanner scan=new Scanner(System.in);
			carnum=scan.nextInt();
			int [][] mat=new int[carnum][carnum];
			int [] result=new int[carnum];
			for(int i=0 ;i<carnum;i++)
			{result[i]=0;}
			for (int i=0 ;i<carnum;i++)
			{for(int j=0;j<carnum;j++)

					{mat[i][j] =scan.nextInt();}
			}
			for (int i=0 ;i<carnum;i++)
			{
				for(int j=0;j<carnum;j++)
				{
					if(mat[i][j]==1 || mat[i][j]==3)
					{result[i]=5;}
				}
			}
			for(int i=0;i<carnum;i++)
			{
				if(result[i]==0)
				{System.out.print(i+1);}
				System.out.print(" ");

			}

	}
}


import java.util.Scanner;
public class contest
{
	public static void main(String[] args)
 	{
			int carnum=0;
			Scanner scan=new Scanner(System.in);
			carnum=scan.nextInt();
			int [][] mat=new int[carnum][carnum];
			int [] result=new int[carnum];
			for(int i=0 ;i<carnum;i++)
				result[i]=0;
			for (int i=0 ;i<carnum;i++)
				for(int j=0;j<carnum;j++)
					mat[i][j] =scan.nextInt();
			for (int i=0 ;i<carnum;i++)
			{
				for(int j=0;j<carnum;j++)
				{
					if(mat[i][j]==1 || mat[i][j]==3)
						result[i]=5;
				}
			}
			int Tnum=0;
			for(int i=0; i<carnum;i++)
			{
				if(result[i]==0)
					Tnum++;
			}
			System.out.println(Tnum);
			for(int i=0;i<carnum;i++)
			{
				if(result[i]==0)
					System.out.print(i+1);
				System.out.print(" ");

			}

	}
}


import java.io.*;
import java.util.*;
import java.text.*;
import java.lang.*;
import java.util.regex.*;
public class Myclass {

	public static void main(String[] args) {

		InputReader in = new InputReader(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		int n=in.nextInt();
		int a[][]=new int [n][n];
		Vector<Integer>v=new Vector<>();
		int j=0;
		for(int i=0;i<n;i++)
		{
			for(j=0;j<n;j++)
			{
				a[i][j]=in.nextInt();
			}
		}
		for(int i=0;i<n;i++)
		{
			for(j=0;j<n;j++)
			{
				if(a[i][j]==1 || a[i][j]==3)
					break;
			}
			if(j==n)
			v.add(i+1);
		}
		pw.println(v.size());
		for(int i=0;i<v.size();i++)
		{
			pw.print(v.get(i)+" ");
		}
		pw.flush();
		pw.close();

	}
		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);
		}
	}
}


import java.io.*;
import java.util.*;
import java.text.*;
import java.lang.*;
import java.util.regex.*;
public class Myclass {

	public static void main(String[] args) {

		InputReader in = new InputReader(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		int n=in.nextInt();
		int a[][]=new int [n][n];
		Vector<Integer>v=new Vector<>();
		int j=0;
		for(int i=0;i<n;i++)
		{
			for(j=0;j<n;j++)
			{
				a[i][j]=in.nextInt();
				if(a[i][j]==1 || a[i][j]==3)
					break;
			}
			if(j==n)
			v.add(i+1);
		}
		pw.println(v.size());
		for(int i=0;i<v.size();i++)
		{
			pw.print(v.get(i)+" ");
		}
		pw.flush();
		pw.close();

	}
		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);
		}
	}
}


import java.io.*;
import java.lang.*;
import java.util.*;
import java.text.*;

public class Main {

	public static void main(String[] args) throws IOException {

		//BufferedReader cin = new BufferedReader(new FileReader("test.txt"));
		 BufferedReader cin = new BufferedReader(new InputStreamReader(System.in));

		String line;
		StringTokenizer st;

		line = cin.readLine();
		st = new StringTokenizer(line);
		int n=Integer.parseInt(st.nextToken());
		//int m=Integer.parseInt(st.nextToken());

		int ans=n;
		boolean[] bad=new boolean[n];
		int t;
		for(int i=0;i<n;i++){
			line = cin.readLine();
			st = new StringTokenizer(line);
			for(int j=0;j<n;j++){
				t=Integer.parseInt(st.nextToken());
				if(t==1){
					bad[i]=true;
					ans--;
				}
				if(t==3){
					if(!bad[i]){
						bad[i]=true;
						ans--;
					}
					if(!bad[j]){
						bad[j]=true;
						ans--;
					}
				}
			}
		}

		System.out.println(ans);
		if(ans>0){
			for(int i=0;i<n;i++){
				if(!bad[i]){
					System.out.print(i+1);
					ans--;
					if(ans>0)System.out.print(" ");
				}
			}
		}

		cin.close();
	}

}


import java.io.*;
import java.lang.*;
import java.util.*;
import java.text.*;

public class Main {

	public static void main(String[] args) throws IOException {

		//BufferedReader cin = new BufferedReader(new FileReader("test.txt"));
		 BufferedReader cin = new BufferedReader(new InputStreamReader(System.in));

		String line;
		StringTokenizer st;

		line = cin.readLine();
		st = new StringTokenizer(line);
		int n=Integer.parseInt(st.nextToken());
		//int m=Integer.parseInt(st.nextToken());

		int ans=n;
		boolean[] bad=new boolean[n];
		int t;
		for(int i=0;i<n;i++){
			line = cin.readLine();
			st = new StringTokenizer(line);
			for(int j=0;j<n;j++){
				t=Integer.parseInt(st.nextToken());
				if(t==1&&!bad[i]){
					bad[i]=true;
					ans--;
				}
				if(t==3){
					if(!bad[i]){
						bad[i]=true;
						ans--;
					}
					if(!bad[j]){
						bad[j]=true;
						ans--;
					}
				}
			}
		}

		System.out.println(ans);
		if(ans>0){
			for(int i=0;i<n;i++){
				if(!bad[i]){
					System.out.print(i+1);
					ans--;
					if(ans>0)System.out.print(" ");
				}
			}
		}

		cin.close();
	}

}


import java.util.Scanner;

public class ToyCars {

    public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] r = new int[n + 1];
        for (int i = 0; i < n; i++) {
            r[i] = 1;
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                int in = scan.nextInt();
                if (in == 1) {
                    r[i] = 0;
                }else if(in==2){
                    r[j] = 0;
                }else if(in==3){
                    r[i] = 0;
                    r[j] = 0;
                }
            }
        }
        int c = 0;
        for (int i = 0; i <n ; i++) {
            if(r[i]==1){
                ++c;
            }
        }
        System.out.println(c);
        for (int i = 0; i < n; i++) {
            if(r[i]==1){
                System.out.print(i+1+" ");
            }
        }
        System.out.println();
    }

}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.Comparator;
import java.io.InputStream;

public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Scanner sc=new Scanner(System.in);

        int n=in.nextInt(),turned=0;
        String t="";
        for(int i=0;i<n;i++){
            boolean turn=false;
            for(int j=0;j<n;j++){
                int status=in.nextInt();
                if(status==1 || status==3){
                    turn=true;
                    break;
                }
            }
            if(!turn){
                t+=(i+1)+" ";
                turned++;
            }
        }
        if(turned==0)
            out.print(0);
        else{
            out.print(turned+"\n"+t);
        }

        out.close();
    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();

            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }

                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();

            while (isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-') {
                sgn = -1;
                c = read();
            }

            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;

            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.Comparator;
import java.io.InputStream;

public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Scanner sc=new Scanner(System.in);

        int n=in.nextInt();
        int cnt=0;
        String str="";
        for(int i=0;i<n;i++){
            boolean good=true;
            for(int j=0;j<n;j++){
                int s=in.nextInt();
                if(s==1 || s==3)
                    good=false;
            }
            if(good){
                cnt++;
                str+=(i+1)+" ";
            }
        }

        if(cnt==0)
            System.out.println(0);
        else{
            System.out.println(cnt+"\n"+str);
        }

        out.close();
    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();

            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }

                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();

            while (isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-') {
                sgn = -1;
                c = read();
            }

            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;

            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.Comparator;
import java.io.InputStream;

public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Scanner sc=new Scanner(System.in);

        int n=in.nextInt(),turned=0;
        for(int i=0;i<n;i++){
            boolean turn=false;
            for(int j=0;j<n;j++){
                int status=in.nextInt();
                if(status==1 || status==3){
                    turn=true;
                    break;
                }
            }
            if(!turn){
                out.print((i+1)+" ");
                turned++;
            }
        }
        if(turned==0)
            out.print(0);

        out.close();
    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();

            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }

                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();

            while (isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-') {
                sgn = -1;
                c = read();
            }

            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;

            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}


import java.util.*;
public class Main{
    public static void main(String[] args) throws Exception {
        //try{
        Scanner s =new Scanner(System.in);
        //System.out.println((-1)%2);
        int n=s.nextInt();
        int[] A = new int[n];
        int ans=0;
        for(int i=0;i<n;i++){
            int count=0;
            for(int j=0;j<n;j++){
                int x=(s.nextInt())%2;
                count=count+x;
            }
            if(count==-1){
                ans++;
                A[i]=1;
            }
        }
        System.out.println(ans);
        for(int i=0;i<n;i++){
            if(A[i]==1){
                System.out.print(i+1+" ");
            }
        }
    }

}


import java.util.*;
public class Main{
    public static void main(String[] args) throws Exception {
        //try{
        Scanner s =new Scanner(System.in);

        int n=s.nextInt();
        int[] A = new int[n];
        int ans=0;
        for(int i=0;i<n;i++){
            int count=0;
            for(int j=0;j<n;j++){
                if(A[j]!=2){
                    int x=s.nextInt();
                    if(i!=j){
                        if(x==2 || x==0){
                            count++;
                            if(x==2)A[j]=2;
                        }
                    }
                }
            }
            if(n-1==count){
                ans++;
                A[i]=1;
            }
        }
        System.out.println(ans);
        for(int i=0;i<n;i++){
            if(A[i]==1){
                System.out.print(i+1+" ");
            }
        }
    }

}


import java.awt.Label;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Test {

    public static void main(String[] args) throws Throwable {
        int i, j;
        Scanner in = new Scanner(System.in);

        int n = in.nextInt();
        int[][] results = new int[n][n];
        int[] goodCars = new int[n];
        for (i = 0; i < n; i++) {
            for (j = 0; j < n; j++) {
                results[i][j] = in.nextInt();
            }
            goodCars[i]=i+1;

        }
        int carNums = n;
        for (i = 0; i < n; i++) {
            for (j = 0; j < n; j++) {
                if (results[i][j] == 1 || results[i][j] == 3) {
                    carNums--;
                    goodCars[i] = 0;
                    break;
                }
            }
        }
        System.out.println(carNums);
        for (i = 0; i < n; i++) {
            if (goodCars[i] != 0) {
                System.out.print(goodCars[i] + " ");
            }

        }

    }

    static class Scanner {

        BufferedReader br;
        StringTokenizer st;

        Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        String next() throws IOException {

            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();

        }

        int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        }

        long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        }

    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Test {

    public static void main(String[] args) throws Throwable {
        int i, j;
        Scanner in = new Scanner(System.in);

        int n = in.nextInt();
        int[][] results = new int[n][n];
        int[] goodCars;
        goodCars = new int[n];
        int carNums =0;
        for (i = 0; i < n; i++) {
            boolean ok=true;
            for (j = 0; j < n; j++) {
                results[i][j] = in.nextInt();
                if (results[i][j] == 1 || results[i][j] == 3) {
                    ok= false;
                }
            }
            if(ok){
                carNums++;
                goodCars[i]=i+1;
            }
        }

//        for (i = 0; i < n; i++) {
//            for (j = 0; j < n; j++) {
//                if (results[i][j] == 1 || results[i][j] == 3) {
//                    carNums--;
//                    goodCars[i] = 0;
//                    break;
//                }
//            }
//        }
        System.out.println(carNums);
        for (i = 0; i < n; i++) {
            if (goodCars[i] != 0) {
                System.out.print(goodCars[i] + " ");
            }
        }

    }

    static class Scanner {

        BufferedReader br;
        StringTokenizer st;

        Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        String next() throws IOException {

            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();

        }

        int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        }

        long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        }

    }
}


//package contest_303;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class A {

    public static void main(String[] args) {
        Scanner sanat = new Scanner(System.in);
        int n = sanat.nextInt();
        int cnt = 0;
        boolean[][] used= new boolean[n+1][n+1];
        Set<Integer> st = new HashSet<Integer>();
        for (int i = 1; i <= n; i++) {
            boolean ok = false;;
            for (int j = 1; j <=n; j++) {
                int a = sanat.nextInt();
                if(a==0){
                    cnt++;
                    if(!used[i][j] && !ok){
                        ok = true;
                        st.add(i);
                        used[i][j] = true;
                        used[j][i] = true;
                    }
                }
            }
        }
        if(cnt==0){
            System.out.println("0");
            return;
        } else{
            System.out.println(cnt/2);
            for (Integer integer : st) {
                System.out.print(integer+" ");
            }
        }
    }
}


//package contest_303;

import java.util.LinkedList;
import java.util.Scanner;
public class A {

    public static void main(String[] args) {
        Scanner sanat = new Scanner(System.in);
        int n = sanat.nextInt();
        LinkedList<Integer> st = new LinkedList<Integer>();
        for (int i = 1; i <= n; i++) {
            boolean ok = false;;
            for (int j = 1; j <=n; j++) {
                int a = sanat.nextInt();
                if(a==1 || a==3){
                    ok = true;
                }
            }
            if(!ok){
                st.add(i);
            }
        }
        System.out.println(st.size());
        for (Integer in : st) {
            System.out.print(in+" ");
        }
    }
}