Select all matrices, represented as lists of lists `M`, for which the above snippet of code prints `True` to the console.
```
# Look at the options for the value of M
n = len(M)
flag = True
for i in range(n):
for j in range(n):
if (i != j) and (M[i][j] != 0):
flag = False
break
elif (i == j) and (M[i][j] != 1):
flag = False
break
if flag == False:
break
print(flag)
```