R=range I=input N=int(I()) A=[[int(c)for c in I()]for i in R(N)] T=[[0]*N for i in R(N)] B=[t[:]for t in T] def e(i,j):return T[i][j]^(B[i][j]