A company decides to simulate on computer the process of manufacturing its own goods. In order to do that, it makes the following observations:
2/3 • All steps of manufacturing process are nodes of the tree; • Each node ensures total dependence of all its own descendants; The tree associated to the diagram from figure 1 is shown in figure 2. Your task is to write a program that builds this dependence tree. Input The input file contains several input data sets. An input data set has the following format: n - number of steps of manufacturing process (2 ≤ n ≤ 99); a11 a12 ... a1n a21 a22 ... a2n . . ... . an1 an2 ... ann where aij = 1 if step j follows directly step i in the process diagram, otherwise aij = 0. Output At output, the program must write n − 1 lines for every input data set; each line has the format: ij with the meaning that node j is a direct descendant of node i in the tree. The pair (i1j1) follows (i2j2) ifandonlyif(i1 <i2)or(i1 =i2 andj1 <j2).
3/3 Sample Input 10 0110000000 0010000000 0001000000 0010110000 0000001000 0000001000 0001000100 0010000011 1000000000 0000001000 Sample Output 12 13 34 45 46 47 78 89 8 10