int input for in range append list map int input split for in range fo

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
n = int(input())
a = 0
b = 0
A = []
for i in range(n):
A.append(list(map(int, input().split())))
for i in range(n):
for j in range(n):
a += A[j][i]
a += A[i][j]
if j == i:
a -= A[j][i]
a -= A[i][j]
if a == 0:
print(i+1, end = ' ')
b += 1
a = 0
if b == 0:
print(0)