X=Y=0 for i in range(int(input())): x,y=map(int,input().split('-')) if(x+y)%4in(1,2):x,y=y,x (xX or y>Y)+(x==y==11)and print('error',i+1)