Little Susie, thanks to her older brother, likes to play with cars. Today she decided to set up a tournament between them. The process of a tournament is described in the next paragraph.

There are n toy cars. Each pair collides. The result of a collision can be one of the following: no car turned over, one car turned over, both cars turned over. A car is good if it turned over in no collision. The results of the collisions are determined by an n × n matrix А: there is a number on the intersection of the і-th row and j-th column that describes the result of the collision of the і-th and the j-th car:    - 1: if this pair of cars never collided.  - 1 occurs only on the main diagonal of the matrix.  0: if no car turned over during the collision.  1: if only the i-th car turned over during the collision.  2: if only the j-th car turned over during the collision.  3: if both cars turned over during the collision. 

Susie wants to find all the good cars. She quickly determined which cars are good. Can you cope with the task?


-----Input-----

The first line contains integer n (1 ≤ n ≤ 100) — the number of cars.

Each of the next n lines contains n space-separated integers that determine matrix A. 

It is guaranteed that on the main diagonal there are  - 1, and  - 1 doesn't appear anywhere else in the matrix.

It is guaranteed that the input is correct, that is, if A_{ij} = 1, then A_{ji} = 2, if A_{ij} = 3, then A_{ji} = 3, and if A_{ij} = 0, then A_{ji} = 0.


-----Output-----

Print the number of good cars and in the next line print their space-separated indices in the increasing order.


-----Examples-----
Input
3
-1 0 0
0 -1 1
0 2 -1

Output
2
1 3 
Input
4
-1 3 3 3
3 -1 3 3
3 3 -1 3
3 3 3 -1

Output
0

Difficulty: interview

Starter code:

Solutions:
n = int(input())
a = [list(map(int, input().split())) for i in range(n)]
res = []
for i in range(n):
    j = 0
    while j < n and 3 != a[i][j] != 1:
        j += 1
    if j == n: res.append(i + 1)
print(len(res))
print(' '.join(map(str, res)))


n = int(input())
arr = [0] * n
for i in range(n):
    arr[i] = list(map(int, input().split()))
    ans = []
for i in range(n):
    for j in range(n):
        if arr[i][j] == 1 or arr[i][j]== 3:
            break
    else:
        ans.append(i + 1)
print(len(ans))
if len(ans) != 0:
    print(*ans)


import math
import sys

n = int(input())
ans=0
c=[]
for i in range(0,n):
    m=0
    l=list(map(int,input().split()))
    for j in l:
        if j==2 or j==0:
            m+=1
    if m==n-1:
        ans+=1
        c.append(i)
print(ans)
for j in c:
    print(j+1, end=" ")
if c!=[]: print()



N = int(input())
mat = [list(map(int, input().split())) for _ in range(N)]
ans = []
for i in range(N):
    flag = True
    for j in range(N):
        if mat[i][j] == 3 or mat[i][j] == 1:
            flag = False
    if flag == True:
        ans.append(i+1)
if len(ans) == 0:
    print(0)
else:
    print(len(ans))
    print(*ans)


n = int(input())

a = []
for i in range(n):
    a.append([int(x) for x in input().split()])

res = []
for i in range(n):
    ok = True
    for j in range(n):
        if a[i][j] == 1 or a[i][j] == 3:
            ok = False
    if ok:
        res.append(i + 1)

print(len(res))
print(" ".join((str(x) for x in res)))

n = int(input())
a = []
c = 0
ans = []
for i in range(n):
    t = list(map(int, input().split()))
    a.append(t)
    
num = 0
for i in a:
    if (not (1 in i)) and (not (3 in i)):
        c += 1
        ans.append(num+1)
    num += 1
    
print(c)
for i in range(c-1):
    print(ans[i], end = ' ')
if c:
    print(ans[c-1])

n=int(input())
s=[]
ans=[]
for i in range(n):
    s.append(list(map(int, input().split())))
for i in range(n):
    f = True
    for j in range(n):
        if s[i][j]==1 or s[j][i]==2 or s[i][j]==3 or s[j][i]==3:
            f = False
    if f:
        ans.append(i)
print(len(ans))
for i in ans:
    print(i+1, end=' ')

n = int(input())
z = []
res = n
for i in range(n):
    s = input().split()
    #print(s)
    j = 0
    t = True
    while t and j < n:
        #print(s[j])
        if (s[j] == '1') or (s[j] == '3'):
            t = False
            res -= 1
        j += 1
    #print(t)
    z.append(t)
#print(z)
print(res)
s = ''
for i in range(len(z)):
    if z[i]:
        s += str(i+1) + ' '

print(s)

n = int(input())
a = [list(map(int, input().split())) for i in range(n)]
a2 = [0] * n
for y in range(n):
    for x in range(n):
        if a[y][x] != -1:
            if a[y][x] == 1:
                a2[y] = 1
            elif a[y][x] == 2:
                a2[x] = 1
            elif a[y][x] == 3:
                a2[x] = 1
                a2[y] = 1
num = 0
for i in range(n):
    if a2[i] == 0:
        num += 1
print(num)
for i in range(n):
    if a2[i] == 0:
        print(i + 1,end=" ")


n = int(input())
ans = []
for i in range(n):
	mas = [int(x) for x in input().split()]
	tr = True
	for x in mas:
		if x == 1 or x == 3:
			tr = False
			break
	if tr:
		ans.append(i + 1)
		
print(len(ans))
ans = [str(x) for x in ans]
print(' '.join(ans))

def __starting_point():
    n = int(input())

    good = []
    for i in range(n):
        for j, x in enumerate(map(int, input().split())):
            if j != i and x in (1, 3):
                break
        else:
            good.append(i + 1)

    print(len(good))
    if good:
        print(' '.join(map(str, good)))
__starting_point()

n = int(input())
A = [list(map(int, input().split())) for i in range(n)]
cnt = 0
ans = []
for i in range(n) :
    for j in range(n) :
        if A[i][j] == 1 or A[i][j] == 3:
            break
    else :
        cnt += 1
        ans.append(i+1)
print(cnt)
for i in ans :
    print(i, end = ' ')


n = int(input())
ar = []
for i in range(n):
    ar.append(list(map(int, input().split())))
ans = [0] * n
for i in range(n):
    for j in range(n):
        if ar[i][j] == 1 or ar[i][j] == 3:
            ans[i] = 1
        if ar[i][j] == 2:
            ans[j] = 1
ans1 = []
for i in range(n):
    if ans[i] == 0:
        ans1.append(i + 1)
print(len(ans1))
for i in range(len(ans1)):
    print(ans1[i], end = ' ')

import math,string,itertools,fractions,heapq,collections,re,array,bisect
from itertools import chain, dropwhile, permutations, combinations
from collections import defaultdict


def main(a,n):
    s = []
    if n==1:
        print(1)
        print(1)
        return
    for i in range(n):
        if 1 in a[i] or 3 in a[i]:
            continue
        s += [i+1,]
    print(len(s))
    print(" ".join([str(i) for i in s]))


def main_input(info=0):
    n = int(input())
    a = []
    for i in range(n):
        a.append(list(map(int,input().split())))
    main(a,n)

def __starting_point():
    main_input()

__starting_point()

a = int(input())
x = []
for i in range(a):
    x.append([int(x) for x in input().split()])
ans = []
for i in range(a):
    cont = True
    for j in range(a):
        if x[i][j] == 1 or x[i][j] == 3:
            cont = False
    if cont:
        ans.append(i + 1)
print(len(ans))
print(*ans)

cars = []
for i in range(int(input())):

    a = 0
    for x in map(int, str.split(input())):

        if x > 0:

            a |= x

    if a & 1 == 0:

        cars.append(i + 1)

print(len(cars))
if cars:

    print(str.join(" ", list(map(str, cars))))


#!/usr/bin/env python
# -*- coding: utf-8 -*-

N = int(input())

good_cars = []
for i in range(N):
    collision = list(map(int,input().split()))
    if collision.count(1) + collision.count(3) == 0:
        good_cars.append(i)
print(len(good_cars))
if len(good_cars) != 0:
    print(' '.join([str(x+1) for x in good_cars]))


cars= int(input())
ans= 0
ansline= []
for i in range(cars):
    inputline= [int(j) for j in input().split()]
    inputline= set(inputline)
    if 1 not in inputline and 3 not in inputline:
        ans+= 1
        ansline.append(i+1)
        

print(ans)
ansline.sort()
a= ""
if ans>0:
    for i in range(ans):
        a+= str(ansline[i])+ " "

print(a)

n=int(input())
row=[[int(x) for x in input().split()] for i in range(n)]
col=[[row[i][j] for i in range(n)] for j in range(n)]
ans=[i for i in range(1,n+1)]
for i in range(1,n+1):
	if 1 in row[i-1] or 3 in row[i-1] or 2 in col[i-1] or 3 in col[i-1]:
		try:
			ans.remove(i)
		except:
			pass
print(len(ans))
print(' '.join([str(x) for x in ans]))


n = int(input())
res = []
a = [[0]*n]*n
for i in range(n):
    a[i] = list(map(int,input().split()))
for i in range(n):
    #print(a[i].count(2))
    if a[i].count(1)>0:
        continue
    elif a[i].count(3)==0:
        res.append(i+1)
'''for j in range(n):
    if a[i].count(2)>0:
        continue
    elif a[i].count(3)==0:
        res.append(i+1)'''
if len(res)==0:
    print(0)
    quit()
print(len(res))
res.sort()
print(' '.join(map(str,res)))

import sys
r = lambda : list(map(int,input().split()))

n = int(input())
a = []
for i in range(n) :
    a.append(list(r()))
goods = list(range(n))
#print(goods)
for i in range(n) :
    for j in range(n) :
        if i==j or a[i][j]==0 or a[i][j]==-1 : continue 
        if a[i][j]==1 and i in goods : goods.remove(i);#print(i+1)
        if a[i][j]==2 and j in goods : goods.remove(j);#print(j+1)
        if a[i][j]==3 :
            if i in goods : goods.remove(i)
            if j in goods : goods.remove(j)

print(len(goods))
#print(goods)
print(' '.join([str(goods[i]+1) for i in range(len(goods))]))
    


n = int(input())
ans = []
for i in range(n):
    s = list(map(int, input().split()))
    count1 = 0
    countIn1 = 0
    for j in s:
        if j == 1 or j == 3:
            count1 += 1
        if j == -1:
            countIn1 += 1
    if count1 == 0 and countIn1 == 1:
        ans.append(i + 1)
print(len(ans))
print(*ans)

a=int(input())
A=[0]*a
for q in range(a):
    B=list(map(float, input().split()))
    for i in range(a):
        if B[i]==1:
            A[q]=A[q]+1
        elif B[i]==2:
            A[i]=A[i]+1
        elif B[i]==3:
            A[q]=A[q]+1
            A[i]=A[i]+1
c=0
C=''
for i in range(a):
    if A[i]==0:
        C=C+str(i+1)+' '
        c=c+1
print(c)
if c!=0:
    print(C)

n = int(input())
data = []
for i in range(n):
    temp = [int(x) for x in input().split()]
    data.append(temp)

answer = []
for i in range(n):
    carGood = True
    for j in range(n):
        if data[i][j] == 1 or data[i][j] == 3:
            carGood = False
            break
    if carGood:
        answer.append(str(i + 1))

if len(answer) == 0:
    print(0)
    return
print(len(answer))
print(" ".join(answer))


import sys

def solve():
	i, nGCars, GCars = 1, 0, []
	ignore = input()

	for line in sys.stdin:
		for c in line.split():
			r = int(c)
			if r == 1 or r == 3:
				break
		else:
			GCars.append(str(i))
			nGCars += 1
		i += 1

	print(nGCars)
	print(" ".join(GCars))

solve()