Half-degrees of vertices#3985

Half-degrees of vertices

1 second
64 megabytes
Very easy

You are given a directed graph represented by an adjacency matrix. Your task is to determine the in-degree and out-degree for each vertex in the graph. The in-degree is the number of edges coming into a vertex, while the out-degree is the number of edges going out from a vertex.

Input

— the number of vertices in the graph (1 \leq N \leq 100), followed by an adjacency matrix consisting of rows, each containing numbers, where each number is either or .

Output

For each vertex, output a pair of numbers: the in-degree followed by the out-degree. Provide these pairs for all vertices.

Examples

Example 1

Loading
Loading