We have:
`a = [[1, 2, 4], [-1, 3, 4], [9, -3, 7]]`

Diagonal traversal as a list:
`[1, -1, 2, 9, 3, 4]`

```
n = int(input())
a = [[0]*n for _ in range(n)]
for i in range(n):
a[i] = [int(j) for j in input().strip().split(" ")]
res = []
for j in range(n):
for k in range(j + 1):
res.append(a[j - k][k])
print(res)
```

How do I get the remaining two diagonals?
I need to get:
`[-3, 4, 7]`

Try this. Define variables COL and ROW and then run the following function with your matrix.