Time limit
2s
Memory limit
256 MB
You are given an N×N square paper represented as a matrix. Each cell contains one of the numbers -1, 0, and 1.
Cut the paper by the following rules.
After all cutting is complete, find the number of papers made only of -1, the number of papers made only of 0, and the number of papers made only of 1.
The first line contains N. N is at least 1, at most 3^7, and is a power of 3.
The next N lines contain the matrix representing the paper. Each line contains N integers separated by spaces, and each integer is one of -1, 0, and 1.
On the first line, print the number of papers made only of -1.
On the second line, print the number of papers made only of 0.
On the third line, print the number of papers made only of 1.