An undirected graph is defined by an adjacency matrix. Find the degrees of all the vertices of the graph.
Input:
- the first line contains the number
n
(
\(1 \leq n \leq 100\)) – number of vertices in the graph;
- followed by
n
lines of
n
numbers, each equal to
0
or
1
, – its adjacency matrix.
Output: output
n
numbers – degrees of graph vertices (one number per line).
Examples
# |
Input |
Output |
1 |
5
0 0 1 0 0
0 0 1 0 1
1 1 0 0 0
0 0 0 0 0
0 1 0 0 0 |
1
2
2
0
1 |