From adjacency matrix to the list of edges - 2#4766

From adjacency matrix to the list of edges - 2

1 second
128 megabytes
Easy

The simple oriented graph is given by the adjacency matrix. Print its representation as a list of edges.

Input

The first line contains number of vertices (1 \le n \le 100) in the graph. Each of the next lines contains elements – the description of adjacency matrix.

Output

Print the list of edges, ordered first by the first vertex in a pair that describes an edge, then by the second vertex.

Examples

Example 1

Loading
Loading