E. Restore the Treetime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPetya had a tree consisting of n vertices numbered with integers from 1 to n. Accidentally he lost his tree. Petya remembers information about k vertices: distances from each of them to each of the n tree vertices.Your task is to restore any tree that satisfies the information that Petya remembers or report that such tree doesn't exist.InputThe first line contains two integers n and k (2 ≤ n ≤ 30 000, 1 ≤ k ≤ min(200, n)) — the number of vertices in the tree and the number of vertices about which Petya remembers distance information.The following k lines contain remembered information. The i-th line contains n integers di, 1, di, 2, ..., di, n (0 ≤ di, j ≤ n - 1), where di, j — the distance to j-th vertex from the i-th vertex that Petya remembers.OutputIf there are no suitable trees, print -1.In the other case, print n - 1 lines: each line should contain two vertices connected by edge in the required tree. You can print edges and vertices in an edge in any order. The tree vertices are enumerated from 1 to n.If there are many solutions print any of them.ExamplesInput5 20 1 2 3 22 1 0 1 2Output2 13 24 35 2Input3 11 2 1Output-1NotePicture for the first sample:  
Input5 20 1 2 3 22 1 0 1 2
Output2 13 24 35 2
['graphs', 'greedy', 'trees', '*2900']