CodeLab Academy 📞 9936 6696
← List Python · Level 8: Nested loops Code · 80 points ← #746 #748 →

#747. Matrix: Set the main diagonal to 0

You are given a matrix of integers. **Set the main diagonal to 0**. ### Input The first line has n n, each of the next n lines has n integers (a square matrix). ### Output The answer.

Examples

Input
5 5
3 -4 -6 -8 9
-3 0 4 9 6
-6 1 2 -6 -7
6 8 1 -9 -3
-5 -2 -7 -8 -5
Output
0 -4 -6 -8 9
-3 0 4 9 6
-6 1 0 -6 -7
6 8 1 0 -3
-5 -2 -7 -8 0
Input
2 2
5 8
2 -6
Output
0 8
2 0

💡 You can solve it with Python, JavaScript or blocks. Read the input line by line with input(). Don't print a question (like input("Number: ")). Print exactly what the output asks for, nothing more.

🔒 You can solve the first 3 problems without an account. Sign up for free to solve this one!