Given the adjacency matrix of an undirected graph with n vertices
numbered from 1 to n, print on a single line the degrees of the
n vertices in order 1, 2, ..., n, separated by a single space.
Recall that the degree of a vertex is the number of edges incident to it,
i.e. the number of 1-values on the corresponding row (or column) of
the adjacency matrix.
Input:
The first line contains the natural number n. The following n lines each
contain n binary values (0 or 1) separated by spaces, representing
the adjacency matrix.
- 1 <= n <= 50
- the matrix is symmetric with 0 on the main diagonal
Output:
The program prints to standard output a single line with the n degrees, separated by
a single space.
Example:
Input:
5
0 1 1 0 0
1 0 0 1 0
1 0 0 0 1
0 1 0 0 0
0 0 1 0 0
Output:
2 2 2 1 1