For problem statement at 0-999/300-399/320-329/329/problemC.txt this is a correct solution, but verifier at 0-999/300-399/320-329/329/verifierC.go ends with case 3 failed: expected "2 1\n3 1\n4 2\n4 3" got "2 1\n1 5\n6 5\n2 4"
input:
6 4
2 6
3 6
2 3
1 4
exit status 1 can you fix the verifier? ```go
package main
import (
"bufio"
"fmt"
"os"
)
func main() {
scanner := bufio.NewScanner(os.Stdin)
scanner.Split(bufio.ScanWords)
readInt := func() int {
scanner.Scan()
x := 0
for _, b := range scanner.Bytes() {
x = x*10 + int(b-'0')
}
return x
}
n := readInt()
m := readInt()
g := make(map[int]map[int]bool)
for i := 0; i < m; i++ {
u := readInt()
v := readInt()
if g[u] == nil {
g[u] = make(map[int]bool)
}
if g[v] == nil {
g[v] = make(map[int]bool)
}
g[u][v] = true
g[v][u] = true
}
degrees := make([]int, n+1)
newGraph := make(map[int]map[int]bool)
active := make(map[int]bool)
for i := 1; i <= n; i++ {
active[i] = true
}
result := make([][2]int, 0, m)
for len(result) < m {
u := -1
for v := range active {
u = v
break
}
if u == -1 {
fmt.Println(-1)
return
}
v := -1
for w := range active {
if u == w {
continue
}
if g[u] != nil && g[u][w] {
continue
}
if newGraph[u] != nil && newGraph[u][w] {
continue
}
v = w
break
}
if v == -1 {
fmt.Println(-1)
return
}
result = append(result, [2]int{u, v})
if newGraph[u] == nil {
newGraph[u] = make(map[int]bool)
}
if newGraph[v] == nil {
newGraph[v] = make(map[int]bool)
}
newGraph[u][v] = true
newGraph[v][u] = true
degrees[u]++
degrees[v]++
if degrees[u] == 2 {
delete(active, u)
}
if degrees[v] == 2 {
delete(active, v)
}
}
for _, e := range result {
fmt.Println(e[0], e[1])
}
}
```