for i in range(9): B[i] = input() for l in range(9): if B[l] is not l+1: answer=l+1 print(answer)