← Home
```go
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	writer := bufio.NewWriter(os.Stdout)
	defer writer.Flush()

	if scanner.Scan() {
		n, _ := strconv.Atoi(scanner.Text())

		// Section 1: Tree where the algorithm is incorrect
		// The algorithm returns min(|V_odd|, |V_even|).
		// The actual answer is the size of Maximum Matching (Konig's Theorem for bipartite graphs).
		// We need MaxMatching < min(|V_odd|, |V_even|).
		// This construction works for n >= 6.
		if n < 6 {
			fmt.Fprintln(writer, "-1")
		} else {
			// Root at 1.
			// 1 connected to 2, 3, 4. (Depth 1 nodes: 2, 3, 4)
			// 2 connected to 5...n. (Depth 2 nodes: 5...n)
			// Even depth nodes: {1, 5...n}, Count = 1 + (n-4) = n-3
			// Odd depth nodes: {2, 3, 4}, Count = 3
			// Since n >= 6, n-3 >= 3. Algorithm output: 3.
			// Max Matching: {(1,3), (2,5)}. Size 2. (Cover is {1, 2}).
			// 2 < 3, so algorithm is wrong.
			fmt.Fprintln(writer, "1 2")
			fmt.Fprintln(writer, "1 3")
			fmt.Fprintln(writer, "1 4")
			for i := 5; i <= n; i++ {
				fmt.Fprintln(writer, "2", i)
			}
		}

		// Section 2: Tree where the algorithm is correct
		// A star graph centered at 1 works.
		// Even depth: {1} (size 1). Odd depth: {2..n} (size n-1).
		// Algorithm output: 1.
		// Max Matching: {(1,2)}. Size 1.
		// Correct.
		for i := 2; i <= n; i++ {
			fmt.Fprintln(writer, "1", i)
		}
	}
}
```