HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Unsorted > problem:


Adjacency matrix to edges list

Section problems

• X to the power of Y
• Connected components
• Arithmetic Operators
• REVERSE ORDER OF WORDS
• A Palace with Many Columns
• Nameplates
• Cycle detection
• Cities and roads
• Adjacency matrix to edges list
• Edges list to Adjacency matrix
• Permutations
• Reverse permutation
• Divisors count
• GCD of ones
• Set cover problem
• Subsets
• The N Queens Problem

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 1000/1000/1000/1000 ms. Memory limit 65000/65000/65000/65000 Kb.

Problem description

Given adjacency matrix of undirected graph. Print this graph in form of edges list.

Input

The first line of the input contains an integer N (1 ≤ N ≤ 100) that denotes the number of verticies in graph. Each of the following N lines contains N integers 1 or 0, where 1 denotes edge and 0 if there is no edge.

Output

Print the edges list of given graph.

Example

stdin stdout

3
0 1 1
1 0 1
1 1 0

1 2
2 3
1 3

Для отправки решений необходимо выполнить вход.

www.contester.ru