CF871E Restore the Tree

Description

Petya 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.

Input Format

The first line contains two integers $ n $ and $ k $ ( $ 2

Output Format

If 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.

Explanation/Hint

Picture for the first sample: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF871E/6f212029526e4d77c3a6bc5fe4ad25b3afc1824a.png)