330_E. Graph Reconstruction_36719
I have an undirected graph consisting of n nodes, numbered 1 through n. Each node has at most two incident edges. For each pair of nodes, there is at most an edge connecting them. No edge connects a node to itself.

I would like to create a new graph in such a way that: 

  * The new graph consists of the same number of nodes and edges as the old graph. 
  * The properties in the first paragraph still hold. 
  * For each two nodes u and v, if there is an edge connecting them in the old graph, there is no edge connecting them in the new graph. 



Help me construct the new graph, or tell me if it is impossible.

Input

The first line consists of two space-separated integers: n and m (1 ≤ m ≤ n ≤ 105), denoting the number of nodes and edges, respectively. Then m lines follow. Each of the m lines consists of two space-separated integers u and v (1 ≤ u, v ≤ n; u ≠ v), denoting an edge between nodes u and v.

Output

If it is not possible to construct a new graph with the mentioned properties, output a single line consisting of -1. Otherwise, output exactly m lines. Each line should contain a description of edge in the same way as used in the input format.

Examples

Input

8 7
1 2
2 3
4 5
5 6
6 8
8 7
7 4


Output

1 4
4 6
1 6
2 7
7 5
8 5
2 8


Input

3 2
1 2
2 3


Output

-1


Input

5 4
1 2
2 3
3 4
4 1


Output

1 3
3 5
5 2
2 4

Note

The old graph of the first example:

<image>

A possible new graph for the first example:

<image>

In the second example, we cannot create any new graph.

The old graph of the third example:

<image>

A possible new graph for the third example:

<image>
import random
s = raw_input().split()

n = int(s[0])
m = int(s[1])

graf = set([])

for i in xrange(m):
    s = raw_input().split()
    u = int(s[0])
    v = int(s[1])
    graf.add((u,v))
    
    #print graf
if m*4>n*(n-1):
    print -1
else:
    edges = 0
    tries = 0
    listv = range(1,n+1)
    while edges < m:
        tries += 1
        if (tries > 10000):
            break
        edges = 0

        random.shuffle(listv)
        for i in xrange(m):
            u = listv[i-1]
            v = listv[i]
            edges = i+1
            if ((u,v) in graf) or ((v,u) in graf):
                edges = 0
                break

    if (tries > 10000):
        print -1
    else:
        for i in xrange(m):
            print listv[i-1], listv[i]
            


    





8 7
1 2
2 3
4 5
5 6
6 8
8 7
7 4
 5 4
1 2
2 3
3 4
4 1
 3 2
1 2
2 3
 5 4
4 2
2 5
1 5
1 4
 6 6
5 1
3 1
4 3
4 6
2 6
5 2
 6 5
6 3
4 1
2 1
2 5
4 5
 7 5
2 4
7 5
3 1
3 6
1 6
 2 1
1 2
 6 3
6 3
6 4
5 4
 5 3
5 1
3 5
4 3
 6 5
5 4
5 6
6 1
3 1
3 4
 6 3
3 4
6 1
5 1
 4 2
4 2
3 1
 7 6
7 1
7 6
4 2
5 2
5 3
4 3
 7 5
1 5
7 2
3 7
4 3
4 6
 30 29
23 9
23 6
6 4
4 22
5 22
5 10
10 1
14 1
14 15
2 15
20 2
20 30
9 30
29 21
21 3
3 25
25 18
18 27
16 27
16 29
28 24
28 11
11 7
7 17
17 8
8 26
13 26
19 13
24 19
 6 4
6 5
2 3
2 1
4 1
 6 4
6 5
4 5
2 1
3 2
 7 4
6 1
4 7
2 5
3 5
 3 3
1 3
2 1
2 3
 4 2
1 3
1 4
 3 2
3 1
2 3
 7 4
5 4
3 1
1 2
2 7
 7 5
3 1
5 4
5 6
2 6
4 2
 5 3
2 4
3 5
3 1
 11 11
10 9
11 10
5 11
5 7
6 7
3 6
2 3
2 9
4 8
1 8
1 4
 65 55
54 57
33 10
58 33
26 38
22 38
50 22
47 32
32 65
65 55
55 42
6 62
3 62
56 3
56 37
19 37
1 61
21 1
39 21
39 40
20 40
20 29
18 53
9 53
2 9
2 24
25 24
60 25
60 43
13 51
13 59
59 23
7 23
7 17
5 17
5 36
30 36
45 28
28 64
64 63
63 8
35 8
46 35
46 48
31 48
31 12
44 52
49 44
11 49
27 11
15 27
15 16
16 41
41 34
14 34
14 4
 5 2
4 1
5 2
 7 3
5 1
3 7
2 4
 6 2
2 4
5 1
 7 4
3 6
6 2
7 2
7 3
 6 4
2 4
2 1
1 3
4 3
 7 2
1 2
4 2
 7 5
4 5
1 5
7 1
3 7
4 3
 8 6
5 4
1 4
1 7
7 8
6 8
6 5
 30 30
28 29
28 6
29 6
15 25
15 19
25 19
11 9
11 30
9 30
4 7
10 7
10 4
23 5
23 12
5 12
13 24
13 21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5
 6 3
1 6
1 2
2 6
 3 1
2 1
 4 3
4 1
3 4
1 3
 5 1
2 1
 7 4
1 5
3 5
2 7
7 4
 40 37
11 17
39 11
39 9
26 9
32 26
25 32
22 25
18 22
5 18
8 5
1 8
23 1
23 27
37 27
37 40
40 14
34 14
34 7
12 7
15 12
15 21
21 6
6 30
30 36
17 36
29 16
16 35
24 35
24 31
3 31
3 13
4 20
4 33
19 38
38 10
10 19
28 2
 6 1
1 6
 7 3
5 3
5 1
1 3
 7 4
5 6
6 2
7 2
7 4
 8 4
4 2
2 5
1 5
1 4
 6 5
6 3
4 1
2 1
2 5
4 3
 7 5
2 4
7 5
3 1
2 6
1 6
 2 1
2 2
 5 3
5 1
3 3
4 3
 6 5
5 4
5 6
6 1
3 1
3 6
 6 3
3 4
6 1
5 2
 7 6
7 1
7 6
4 2
5 2
7 3
4 3
 7 5
1 5
7 2
3 7
4 3
4 3
 30 29
23 9
23 6
6 4
4 22
5 22
5 10
10 1
14 1
5 15
2 15
20 2
20 30
9 30
29 21
21 3
3 25
25 18
18 27
16 27
16 29
28 24
28 11
11 7
7 17
17 8
8 26
13 26
19 13
24 19
 10 4
6 5
4 5
2 1
3 2
 3 3
1 3
3 1
2 3
 65 55
30 57
33 10
58 33
26 38
22 38
50 22
47 32
32 65
65 55
55 42
6 62
3 62
56 3
56 37
19 37
1 61
21 1
39 21
39 40
20 40
20 29
18 53
9 53
2 9
2 24
25 24
60 25
60 43
13 51
13 59
59 23
7 23
7 17
5 17
5 36
30 36
45 28
28 64
64 63
63 8
35 8
46 35
46 48
31 48
31 12
44 52
49 44
11 49
27 11
15 27
15 16
16 41
41 34
14 34
14 4
 6 2
4 1
5 2
 30 30
28 29
28 6
29 6
15 25
15 19
25 19
11 9
11 30
9 30
4 7
10 7
10 4
23 5
23 12
5 12
13 24
13 21
21 24
3 17
3 22
22 17
16 18
1 18
1 16
27 2
20 27
2 20
14 1
14 26
8 26
 20 12
18 8
7 4
4 9
9 3
12 3
12 10
16 10
14 17
17 1
19 1
11 14
15 6
 7 1
5 1
 4 1
2 3
 7 2
14 3
2 1
 6 4
1 3
2 6
6 4
5 2
 5 5
10 4
1 5
2 1
3 2
3 4
 9 7
9 8
1 2
1 3
3 7
9 6
6 2
5 4
 5 4
5 2
3 4
5 1
3 1
 20 10
5 14
17 20
12 8
13 10
19 1
3 11
15 13
16 18
6 9
2 4
 7 6
4 6
6 7
4 7
3 7
2 5
1 2
 30 20
13 16
2 13
25 26
26 22
23 23
11 23
8 4
8 10
21 15
15 1
3 6
6 24
9 17
30 9
27 7
28 27
18 5
19 18
29 14
14 12
 6 3
1 11
1 2
2 6
 7 4
1 5
3 5
2 7
6 4
 40 37
11 17
39 11
39 9
26 9
32 26
25 32
22 25
18 22
5 18
8 5
1 8
23 1
23 27
37 27
37 40
40 14
34 14
34 7
12 7
15 17
15 21
21 6
6 30
30 36
17 36
29 16
16 35
24 35
24 31
3 31
3 13
4 20
4 33
19 38
38 10
10 19
28 2
 7 3
5 3
5 1
1 5
 7 4
5 6
6 2
7 1
7 4
 5 4
1 2
2 3
3 2
4 1
 6 5
6 3
4 1
2 1
3 5
4 3
 7 6
2 1
7 6
4 2
5 2
7 3
4 3
 11 1
5 1
 4 2
2 3
 7 5
5 6
3 7
6 1
2 1
2 4
 6 3
6 6
4 2
3 1
 4 3
4 2
3 4
3 2
 6 2
10 1
5 2
 7 1
2 1
 6 3
3 4
12 1
5 2
 30 29
23 9
23 6
6 4
4 22
5 22
5 10
10 1
14 1
5 15
2 15
20 2
20 30
9 30
29 21
21 3
3 25
25 18
18 27
16 27
16 29
28 24
28 11
11 7
7 17
17 8
7 26
13 26
19 13
24 19
 10 4
6 5
4 5
2 1
5 2
 3 3
1 3
3 1
2 1
 65 55
30 57
33 10
58 33
26 38
22 38
50 22
47 32
32 65
65 55
55 42
6 62
3 62
56 3
56 37
19 37
1 61
21 1
39 21
39 40
20 40
20 29
18 53
9 53
2 9
2 24
25 24
60 25
60 43
13 51
13 59
59 23
7 23
7 17
5 17
5 36
30 36
45 28
28 64
64 63
63 8
35 8
46 35
46 48
31 42
31 12
44 52
49 44
11 49
27 11
15 27
15 16
16 41
41 34
14 34
14 4
 7 2
4 1
5 2
 30 30
28 29
28 6
29 6
15 25
15 19
25 19
11 9
11 30
9 30
4 7
10 7
3 4
23 5
23 12
5 12
13 24
13 21
21 24
3 17
3 22
22 17
16 18
1 18
1 16
27 2
20 27
2 20
14 1
14 26
8 26
 7 5
5 6
2 7
6 1
2 1
2 4

4 3
3 7
7 6
6 1
1 5
5 2
2 8
 1 3
3 5
5 4
4 2
 -1 4 5
5 3
3 1
1 2
 4 1
1 6
6 5
5 3
3 2
2 4
 2 6
6 4
4 3
3 1
1 5
 5 3
3 7
7 2
2 6
6 4
 -1
 5 3
3 2
2 1
 5 4
4 1
1 3
 5 3
3 6
6 2
2 4
4 1
 5 3
3 2
2 1
 1 4
4 3
 6 2
2 3
3 7
7 4
4 5
5 1
 3 5
5 4
4 2
2 1
1 7
 29 24
24 17
17 1
1 3
3 11
11 8
8 19
19 12
12 15
15 10
10 28
28 20
20 18
18 2
2 26
26 14
14 7
7 22
22 27
27 23
23 30
30 6
6 9
9 21
21 5
5 25
25 4
4 13
13 16
 2 6
6 4
4 3
3 1
 2 6
6 4
4 3
3 1
 7 6
6 4
4 3
3 2
 -1
 1 2
2 4
 -1
 7 6
6 4
4 3
3 2
 7 6
6 4
4 3
3 2
2 5
 2 3
3 4
4 5
 7 3
3 8
8 10
10 5
5 2
2 11
11 4
4 6
6 9
9 1
1 7
 36 6
6 7
7 26
26 33
33 41
41 2
2 59
59 56
56 34
34 11
11 24
24 9
9 12
12 58
58 28
28 31
31 10
10 19
19 64
64 22
22 20
20 46
46 1
1 54
54 29
29 61
61 13
13 60
60 32
32 18
18 27
27 14
14 53
53 44
44 62
62 40
40 3
3 17
17 15
15 39
39 4
4 57
57 55
55 50
50 25
25 65
65 42
42 52
52 63
63 45
45 47
47 16
16 38
38 35
35 37
 4 5
5 3
 7 6
6 4
4 3
 5 3
3 2
 7 6
6 4
4 3
3 2
 4 6
6 5
5 3
3 2
 5 3
3 7
 7 5
5 3
3 6
6 4
4 1
 4 3
3 7
7 6
6 1
1 5
5 2
 10 28
28 7
7 5
5 29
29 19
19 20
20 22
22 23
23 17
17 8
8 4
4 15
15 26
26 3
3 21
21 12
12 16
16 9
9 14
14 27
27 11
11 13
13 1
1 24
24 2
2 18
18 25
25 6
6 30
30 10
 7 6
6 4
4 3
3 2
2 5
 5 3
3 2
2 1
 3 1
1 4
4 2
 7 4
4 3
3 1
1 6
6 5
5 2
 4 5
5 3
3 1
1 2
2 6
 1 7
7 4
4 3
3 5
5 8
8 2
 6 7
7 2
2 4
4 3
3 5
 2 5
5 6
6 3
3 4
4 1
 9 4
4 7
7 11
11 8
8 2
2 3
3 10
10 5
5 6
 4 12
12 18
18 11
11 15
15 14
14 7
7 2
2 17
17 20
20 13
13 10
10 5
 5 3
3 2
2 1
1 6
 2 1
1 5
5 3
3 4
 7 6
6 4
4 3
 7 6
 5 3
3 7
7 2
 7 5
5 3
3 6
6 4
4 1
1 2
 3 1
1 2
2 4
 -1
 2 6
6 5
5 7
7 1
1 4
4 3
3 2
 1 4
 7 6
6 4
 5 4
4 1
 2 1
1 6
6 3
3 5
5 7
7 8
 5 3
3 2
2 1
1 6
 3 5
5 4
4 2
2 1
1 7
 3 1
1 4
4 2
2 5
5 3
 6 9
9 7
7 2
2 3
3 5
5 1
1 8
 4 5
5 3
3 2
2 1
 15 14
14 8
8 5
5 1
1 17
17 10
10 13
13 3
3 20
20 11
 2 6
6 4
4 3
3 1
1 5
5 2
 5 7
7 1
1 2
2 4
4 8
8 3
3 6
6 5
 3 4
4 1
1 7
7 2
2 6
6 5
 7 6
6 4
4 3
3 2
2 5
5 1
 3 4
4 1
1 7
7 2
 5 3
3 2
 29 24
24 17
17 1
1 3
3 11
11 8
8 19
19 12
12 15
15 10
10 28
28 20
20 18
18 2
2 26
26 14
14 7
7 22
22 27
27 23
 1 4
4 2
2 7
7 5
5 3
 4 6
6 5
5 3
 3 1
 -1
 5 4
 7 6
6 4
4 3
3 2
 38 35
35 23
23 13
13 10
10 40
40 20
20 3
3 30
30 16
16 34
34 11
11 25
25 17
17 5
5 27
27 21
21 14
14 9
9 37
37 2
2 6
6 15
15 26
26 29
29 12
12 32
32 28
28 18
18 31
31 33
33 24
24 1
1 7
7 8
8 39
39 22
22 4
 5 3
 7 6
6 4
4 3
 7 6
6 4
4 3
3 2
 4 3
3 7
7 6
6 1
 2 6
6 4
4 5
5 1
1 3
 7 6
6 4
4 3
3 2
2 5
 1 2
 5 4
4 1
1 3
 6 4
4 1
1 5
5 3
3 2
 5 3
3 2
2 1
 7 5
5 3
3 6
6 4
4 1
1 2
 7 5
5 3
3 6
6 4
4 1
 29 24
24 17
17 1
1 3
3 11
11 8
8 19
19 12
12 15
15 10
10 28
28 20
20 18
18 2
2 26
26 14
14 7
7 22
22 27
27 23
23 30
30 6
6 9
9 21
21 5
5 25
25 4
4 13
13 16
 7 1
1 4
4 6
6 8
 -1
 36 6
6 7
7 26
26 33
33 41
41 2
2 59
59 56
56 34
34 11
11 24
24 9
9 12
12 58
58 28
28 31
31 10
10 19
19 64
64 22
22 20
20 46
46 1
1 54
54 29
29 61
61 13
13 60
60 32
32 18
18 27
27 14
14 53
53 44
44 62
62 40
40 3
3 17
17 15
15 39
39 4
4 57
57 55
55 50
50 25
25 65
65 42
42 52
52 63
63 45
45 47
47 16
16 38
38 35
35 37
 5 3
3 2
 10 28
28 7
7 5
5 29
29 19
19 20
20 22
22 23
23 17
17 8
8 4
4 15
15 26
26 3
3 21
21 12
12 16
16 9
9 14
14 27
27 11
11 13
13 1
1 24
24 2
2 18
18 25
25 6
6 30
30 10
 4 12
12 18
18 11
11 15
15 14
14 7
7 2
2 17
17 20
20 13
13 10
10 5
 5 3
 1 4
 5 3
3 7
 5 3
3 2
2 1
1 6
 3 1
1 4
4 2
2 5
5 3
 6 1
1 9
9 4
4 8
8 3
3 2
2 7
 3 2
2 1
1 4
4 5
 10 19
19 20
20 14
14 15
15 11
11 17
17 4
4 5
5 9
9 12
 3 4
4 1
1 7
7 2
2 6
6 5
 29 24
24 17
17 1
1 3
3 11
11 8
8 19
19 12
12 15
15 10
10 28
28 20
20 18
18 2
2 26
26 14
14 7
7 22
22 27
27 23
 4 6
6 5
5 3
 6 2
2 3
3 7
7 4
 38 35
35 23
23 13
13 10
10 40
40 20
20 3
3 30
30 16
16 34
34 11
11 25
25 17
17 5
5 27
27 21
21 14
14 9
9 37
37 2
2 6
6 15
15 26
26 29
29 12
12 32
32 28
28 18
18 31
31 33
33 24
24 1
1 7
7 8
8 39
39 22
22 4
 7 6
6 4
4 3
 7 6
6 4
4 3
3 2
 2 4
4 3
3 5
5 1
 3 1
1 6
6 4
4 2
2 5
 1 7
7 5
5 4
4 6
6 2
2 3
 7 11
 1 4
4 3
 7 6
6 4
4 3
3 2
2 5
 5 3
3 2
2 1
 -1
 5 3
3 2
 5 3
 5 3
3 2
2 1
 29 24
24 17
17 1
1 3
3 11
11 8
8 19
19 12
12 15
15 10
10 28
28 20
20 18
18 2
2 26
26 14
14 7
7 22
22 27
27 23
23 30
30 6
6 9
9 21
21 5
5 25
25 4
4 13
13 16
 7 1
1 4
4 6
6 8
 -1
 36 6
6 7
7 26
26 33
33 41
41 2
2 59
59 56
56 34
34 11
11 24
24 9
9 12
12 58
58 28
28 31
31 10
10 19
19 64
64 22
22 20
20 46
46 1
1 54
54 29
29 61
61 13
13 60
60 32
32 18
18 27
27 14
14 53
53 44
44 62
62 40
40 3
3 17
17 15
15 39
39 4
4 57
57 55
55 50
50 25
25 65
65 42
42 52
52 63
63 45
45 47
47 16
16 38
38 35
35 37
 5 3
3 7
 10 28
28 7
7 5
5 29
29 19
19 20
20 22
22 23
23 17
17 8
8 4
4 15
15 26
26 3
3 21
21 12
12 16
16 9
9 14
14 27
27 11
11 13
13 1
1 24
24 2
2 18
18 25
25 6
6 30
30 10
 7 6
6 4
4 3
3 2
2 5
