Mahmoud was trying to solve the vertex cover problem on trees. The problem statement is:

Given an undirected tree consisting of n nodes, find the minimum number of vertices that cover all the edges. Formally, we need to find a set of vertices such that for each edge (u, v) that belongs to the tree, either u is in the set, or v is in the set, or both are in the set. Mahmoud has found the following algorithm:  Root the tree at node 1.  Count the number of nodes at an even depth. Let it be evenCnt.  Count the number of nodes at an odd depth. Let it be oddCnt.  The answer is the minimum between evenCnt and oddCnt. 

The depth of a node in a tree is the number of edges in the shortest path between this node and the root. The depth of the root is 0.

Ehab told Mahmoud that this algorithm is wrong, but he didn't believe because he had tested his algorithm against many trees and it worked, so Ehab asked you to find 2 trees consisting of n nodes. The algorithm should find an incorrect answer for the first tree and a correct answer for the second one.


-----Input-----

The only line contains an integer n (2 ≤ n ≤ 10^5), the number of nodes in the desired trees.


-----Output-----

The output should consist of 2 independent sections, each containing a tree. The algorithm should find an incorrect answer for the tree in the first section and a correct answer for the tree in the second. If a tree doesn't exist for some section, output "-1" (without quotes) for that section only.

If the answer for a section exists, it should contain n - 1 lines, each containing 2 space-separated integers u and v (1 ≤ u, v ≤ n), which means that there's an undirected edge between node u and node v. If the given graph isn't a tree or it doesn't follow the format, you'll receive wrong answer verdict.

If there are multiple answers, you can print any of them.


-----Examples-----
Input
2

Output
-1
1 2

Input
8

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


-----Note-----

In the first sample, there is only 1 tree with 2 nodes (node 1 connected to node 2). The algorithm will produce a correct answer in it so we printed  - 1 in the first section, but notice that we printed this tree in the second section.

In the second sample:

In the first tree, the algorithm will find an answer with 4 nodes, while there exists an answer with 3 nodes like this: [Image] In the second tree, the algorithm will find an answer with 3 nodes which is correct: [Image]

Difficulty: MEDIUM
Tags: Tree algorithms

Constructive algorithms
Expected Time Complexity: O(N)

Starter code:

Solutions:
from sys import stdin, stdout
n = int(stdin.readline())
if n <= 5:
	stdout.write('-1\n')
	for i in range(n - 1):
		stdout.write(str(i + 1) + ' ' + str(i + 2) + '\n')
else:
	if n & 1:
		last = 0
		for i in range(n // 2 + 1):
			stdout.write('1 ' + str(i + 2) + '\n')
			last = i + 3
		for i in range(n // 2 - 1):
			stdout.write('2 ' + str(last) + '\n')
			last += 1
	else:
		last = 0
		for i in range(n // 2):
			stdout.write('1 ' + str(i + 2) + '\n')
			last = i + 3
		for i in range(n // 2 - 1):
			stdout.write('2 ' + str(last) + '\n')
			last += 1
	for i in range(n - 1):
		stdout.write(str(i + 1) + ' ' + str(i + 2) + '\n')


from sys import stdin
from collections import deque
mod = 10 ** 9 + 7
import sys
sys.setrecursionlimit(10 ** 5)
from queue import PriorityQueue
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
import heapq
input = lambda : sys.stdin.readline().rstrip()
from sys import stdin, stdout
from heapq import heapify, heappush, heappop
n = int(input())
if n < 6:
	print(-1)
	for i in range(n - 1):
		print(i + 1, i + 2)
else:
	for i in range(1, 4):
		print(1, i + 1)
	for i in range(5, n + 1):
		print(2, i)
	for i in range(n - 1):
		print(i + 1, i + 2)


import os
import sys
from io import BytesIO, IOBase
from collections import Counter
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def lcm(a, b):
	return a * b / gcd(a, b)

def main():
	n = int(input())
	if n < 6:
		print(-1)
	else:
		for i in range(2, n - 2 + 1):
			print(1, i)
		print(2, n - 1)
		print(2, n)
	for i in range(1, n):
		print(i, i + 1)
	return
main()


n = int(input())
if n < 6:
	print(-1)
else:
	for i in range(2, 5):
		print('1 ' + str(i))
	for i in range(5, n + 1):
		print('2 ' + str(i))
for i in range(1, n):
	print(str(i) + ' ' + str(i + 1))


n = int(input())
if n <= 5:
	print(-1)
else:
	print(1, 2)
	print(1, 3)
	print(1, 4)
	print(2, 5)
	print(2, 6)
	for i in range(7, n + 1):
		print(1, i)
for i in range(2, n + 1):
	print(1, i)


n = int(input())
if n < 6:
	print(-1)
else:
	print(1, 2)
	for i in range(3, n + 1):
		print(i % 2 + 1, i)
for i in range(1, n):
	print(i, i + 1)


k = int(input())
if k <= 5:
	print(-1)
	for i in range(2, k + 1):
		print(1, i)
else:
	for i in range(2, k - 1):
		print(1, i)
	print(k - 2, k - 1)
	print(k - 2, k)
	for i in range(2, k + 1):
		print(1, i)


n = int(input().strip())
if n <= 5:
	print(-1)
else:
	for i in range(2, n - 1):
		print(1, i)
	for i in range(n - 1, n + 1):
		print(2, i)
for i in range(1, n):
	print(i, i + 1)


def main():
	n = int(input())
	if n < 6:
		print(-1)
	else:
		for x in range(2, n // 2 + 2):
			print(1, x)
		for x in range(n // 2 + 2, n + 1):
			print(2, x)
	for x in range(n - 1):
		print(x + 1, x + 2)
main()


def get_correct_tree(n):
	for i in range(2, n + 1):
		print(1, i)

def get_incorrect_tree(n):
	if n < 6:
		print(-1)
		return
	for i in range(2, n - 1):
		print(1, i)
	print(2, n - 1)
	print(2, n)
n = int(input())
get_incorrect_tree(n)
get_correct_tree(n)


n = int(input())
if n < 6:
	print(-1)
else:
	print('1 2')
	print('1 3')
	print('1 4')
	x = 5
	for i in range(4, n):
		print('4 %d' % x)
		x += 1
for j in range(1, n):
	print('%d %d' % (j, j + 1))


n = int(input())
if n <= 5:
	print(-1)
else:
	print(str(1) + ' ' + str(2))
	print(str(2) + ' ' + str(3))
	print(str(2) + ' ' + str(4))
	print(str(4) + ' ' + str(5))
	print(str(4) + ' ' + str(6))
	k = 5
	while k < n - 1:
		print(str(4) + ' ' + str(k + 2))
		k += 1
h = 0
while h < n - 1:
	print(str(1) + ' ' + str(h + 2))
	h += 1


n = int(input())
if n < 6:
	print(-1)
else:
	baseans = [(1, 2), (1, 3), (1, 4), (4, 5), (4, 6)]
	for p in baseans:
		print('%d %d' % (p[0], p[1]))
	for i in range(7, n + 1):
		print('%d %d' % (4, i))
for i in range(2, n + 1):
	print('%d %d' % (1, i))


n = int(input())
if n < 6:
	print(-1)
else:
	print('1 2\n1 3\n1 4')
	for i in range(5, n + 1):
		print('2 ' + str(i))
for i in range(2, n + 1):
	print('1 ' + str(i))


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
import copy
import time
starttime = time.time()
mod = int(pow(10, 9) + 7)
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def L():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
try:
	sys.stdin = open('input.txt', 'r')
except:
	pass
n = L()[0]
if n < 6:
	print(-1)
else:
	print(1, 2)
	print(1, 3)
	print(1, 4)
	for i in range(5, n + 1):
		print(2, i)
for i in range(1, n):
	print(i, i + 1)
endtime = time.time()


def main():
	n = int(input())
	if n < 6:
		print(-1)
	else:
		print(1, 2)
		print(2, 3)
		print(2, 4)
		for i in range(5, n + 1):
			print(1, i)
	for i in range(1, n):
		print(i, i + 1)
main()


n = int(input())
if n <= 5:
	print(-1)
else:
	print('1 2', '1 3', '1 4', '2 5', sep='\n')
	for i in range(6, n + 1):
		print('2 {0:d}'.format(i))
for i in range(2, n + 1):
	print('1 {0:d}'.format(i))


n = int(input())
ans = []
if n < 6:
	print(-1)
else:
	for i in range(2, n - 1):
		ans.append('1 %i\n' % i)
	ans.append('2 %i\n2 %i\n' % (n - 1, n))
for i in range(2, n + 1):
	ans.append('1 %i\n' % i)
print(*ans, sep='')


s = input()
n = int(s)

def generator():
	if n > 5:
		yield '1 2'
		for i in range(3, (n + 1) // 2 + 2):
			yield '1 {}'.format(i)
		for i in range((n + 1) // 2 + 2, n + 1):
			yield '2 {}'.format(i)
	else:
		yield '-1'
	for i in range(2, n + 1):
		yield '1 {}'.format(i)
print('\n'.join(generator()))


import atexit
import io
import sys
_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__
_OUTPUT_BUFFER = io.StringIO()
sys.stdout = _OUTPUT_BUFFER

@atexit.register
def write():
	sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())

def main():
	n = int(input())
	if n < 6:
		print(-1)
	else:
		print('1 2')
		print('2 3')
		print('2 4')
		for j in range(5, n + 1):
			print(1, j)
	for j in range(2, n + 1):
		print(1, j)
main()


import sys
import os.path
from collections import *
import math
import bisect
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
else:
	input = sys.stdin.readline
n = int(input())
if n == 2 or n == 3 or n == 4 or (n == 5):
	print(-1)
else:
	print(1, 2)
	print(2, 3)
	print(2, 4)
	for i in range(5, n + 1):
		print(4, i)
for i in range(2, n + 1):
	print(1, i)


n = int(input())
if n < 6:
	print(-1)
else:
	if n % 2 == 0:
		c = 2
		for i in range(n // 2):
			print(1, c)
			c += 1
		for i in range(n // 2 - 1):
			print(2, c)
			c += 1
	if n % 2 == 1:
		c = 2
		for i in range(n // 2):
			print(1, c)
			c += 1
		for i in range(n // 2):
			print(2, c)
			c += 1
for i in range(2, n + 1):
	print(1, i)


import sys
mod = 1000000007

def get_array():
	return list(map(int, sys.stdin.readline().split()))

def get_ints():
	return map(int, sys.stdin.readline().split())

def input():
	return sys.stdin.readline()

def print_array(a):
	print(' '.join(map(str, a)))

def main():
	n = int(input())
	if n < 6:
		print('-1')
	else:
		print('1 2\n1 3\n1 4')
		for val in range(5, n + 1):
			print('2 ' + str(val))
	for val in range(2, n + 1):
		print('1 ' + str(val))
main()


def correct(n):
	for i in range(1, n):
		print(1, i + 1)

def incorrect(n):
	if n <= 5:
		print(-1)
	else:
		m = int(n / 2) + 1
		for i in range(1, m):
			print(1, i + 1)
		for i in range(m, n):
			print(2, i + 1)

def main():
	n = int(input())
	incorrect(n)
	correct(n)
main()


import sys
from math import *
readints = lambda : map(int, input().strip('\n').split())
n = int(input())

def incorrect(n):
	if n <= 5:
		print(-1)
	else:
		for i in range(2, n - 2 + 1):
			print(1, i)
		print(2, n - 1)
		print(2, n)

def correct(n):
	for i in range(2, n + 1):
		print(1, i)
incorrect(n)
correct(n)


import sys
lines = sys.stdin.readlines()
n = int(lines[0].strip())
if n <= 5:
	print(-1)
else:
	print('{} {}'.format(1, 2))
	for i in range(3, n + 1):
		if i % 2 == 0:
			print('{} {}'.format(i, 2))
		else:
			print('{} {}'.format(i, 1))
for i in range(1, n):
	print('{} {}'.format(i, i + 1))


n = int(input())
if n <= 5:
	print(-1)
	for a in range(n - 1):
		print(a + 1, a + 2)
	exit(0)
print(1, 2)
print(1, 3)
print(1, 4)
for i in range(5, n + 1):
	print(2, i)
for a in range(n - 1):
	print(a + 1, a + 2)


n = int(input())
if n <= 5:
	print(-1)
else:
	print('\n'.join(['1 ' + str(i) for i in range(2, 5)]))
	end = False
	ans = []
	head = 2
	while True:
		i = head
		j = i + 3
		while j <= i + 5:
			tmp_ans = str(i) + ' ' + str(j)
			ans.append(tmp_ans)
			if j == n:
				end = True
				break
			j += 1
		if end:
			break
		head += 3
	print('\n'.join(ans))
print('\n'.join(['1 ' + str(i) for i in range(2, n + 1)]))


from math import ceil
n = int(input())
if n <= 5:
	print(-1)
else:
	for i in range(2, n // 2 + 2):
		print(1, i)
	for j in range(2 + n // 2, n + 1):
		print(2, j)
for k in range(1, n):
	print(k, k + 1)


n = int(input())

def print_wrong(l):
	if l < 6:
		print('-1')
	else:
		for i in range(0, l - 1):
			if i % 2 == 0:
				first = '1 '
			else:
				first = '2 '
			print(first + str(i + 2))

def print_right(l):
	for i in range(0, l - 1):
		print('1 %s' % str(i + 2))
print_wrong(n)
print_right(n)


n = int(input())
if n < 6:
	print('-1')
else:
	k = 2
	while k <= 4:
		print('1', k)
		k += 1
	while k <= n:
		print('2', k)
		k += 1
i = 1
while i <= n - 1:
	print(i, i + 1)
	i += 1


import sys
import math
MAXNUM = math.inf
MINNUM = -1 * math.inf
ASCIILOWER = 97
ASCIIUPPER = 65

def getInt():
	return int(sys.stdin.readline().rstrip())

def getInts():
	return map(int, sys.stdin.readline().rstrip().split(' '))

def getString():
	return sys.stdin.readline().rstrip()

def printOutput(a, b):
	if not a:
		sys.stdout.write(str(-1) + '\n')
	else:
		for (x, y) in a:
			sys.stdout.write(str(x) + ' ' + str(y) + '\n')
	for (x, y) in b:
		sys.stdout.write(str(x) + ' ' + str(y) + '\n')

def incorrectAlg(ln):
	ans = []
	for i in range(1, ln - 3):
		ans.append((1, i + 1))
	ans.append((1, ln - 2))
	ans.append((ln - 2, ln - 1))
	ans.append((ln - 2, ln))
	return ans

def correctAlgorithm(ln):
	ans = []
	for i in range(1, ln):
		ans.append((i, i + 1))
	return ans

def solve(ln):
	if ln < 6:
		a = None
	else:
		a = incorrectAlg(ln)
	b = correctAlgorithm(ln)
	return (a, b)

def readinput():
	ln = getInt()
	printOutput(*solve(ln))
readinput()


import sys
import math
from collections import Counter
from operator import itemgetter
import queue

def IO():
	sys.stdin = open('pyinput.txt', 'r')
	sys.stdout = open('pyoutput.txt', 'w')

def GCD(a, b):
	if b == 0:
		return a
	else:
		return GCD(b, a % b)

def LCM(a, b):
	return a * (b // GCD(a, b))

def scan(TYPE_1, TYPE_2=0):
	if TYPE_1 == int:
		return map(int, sys.stdin.readline().strip().split())
	elif TYPE_1 == float:
		return map(float, sys.stdin.readline().strip().split())
	elif TYPE_1 == list and TYPE_2 == float:
		return list(map(float, sys.stdin.readline().strip().split()))
	elif TYPE_1 == list and TYPE_2 == int:
		return list(map(int, sys.stdin.readline().strip().split()))
	elif TYPE_1 == str:
		return sys.stdin.readline().strip()
	else:
		print('ERROR!!!!')

def main():
	n = int(input())
	if n < 6:
		print(-1)
	else:
		print(1, 2)
		print(1, 3)
		print(1, 4)
		for i in range(5, n + 1):
			print(4, i)
	for i in range(2, n + 1):
		print(1, i)
main()


def wrong(x):
	if n < 6:
		print(-1)
	else:
		print('1 2')
		print('2 3')
		print('2 4')
		print('4 5')
		print('4 6')
		for i in range(7, x + 1):
			print('4', i)

def true(x):
	for i in range(x - 1):
		print(i + 1, i + 2)
n = int(input())
wrong(n)
true(n)


import sys
n = int(input().strip())
if n < 6:
	print(-1)
else:
	print(1, 2)
	for i in range(3, n + 1):
		print(i % 2 + 1, i)
for i in range(n - 1):
	print(1, i + 2)


import sys
n = int(sys.stdin.readline())
if n < 6:
	print(-1)
else:
	print('1 2')
	for i in range(3, n + 1):
		if i % 2 == 0:
			print('2 ' + str(i))
		else:
			print('1 ' + str(i))
for i in range(2, n + 1):
	print('1 ' + str(i))


n = int(input())

def print_wrong(n):
	print('1 2')
	print('1 3')
	print('1 4')
	print('3 5')
	print('3 6')
	for i in range(7, n + 1):
		print('1 %s' % i)

def print_correct(n):
	for i in range(2, n + 1):
		print('1 %s' % i)
if n < 6:
	print('-1')
else:
	print_wrong(n)
print_correct(n)


import math
n = int(input())
if n <= 5:
	print(-1)
else:
	for i in range(2, math.floor(n / 2) + 2):
		print(1, i)
	for i in range(math.floor(n / 2) + 2, n + 1):
		print(math.floor(n / 2) + 1, i)
for i in range(1, n):
	print(i, i + 1)


n = int(input())
if n in range(2, 5 + 1):
	print('-1')
	for i in range(2, n + 1):
		print('1', i)
else:
	print('1 2')
	p = n // 2 - 2
	for i in range(p + 1):
		print('2', i + 3)
	for i in range(n - p - 3):
		print('1', i + p + 4)
	for i in range(n - 1):
		print('1', i + 2)


n = int(input())
wrong = str()
if n <= 5:
	wrong = -1
else:
	wrong = '\n'.join([f'1 {i}' for i in range(2, n - 1)] + [f'2 {n - 1}', f'2 {n}'])
right = '\n'.join([f'1 {i}' for i in range(2, n + 1)])
print(wrong)
print(right)


import sys
input = sys.stdin.readline
n = int(input())
if n < 6:
	print(-1)
	for i in range(n - 1):
		print(i + 1, i + 2)
else:
	k = n - 2
	k1 = k // 2
	k2 = k - k1
	for i in range(k1):
		print(i + 1, n - 1)
	for i in range(k1, n - 1):
		print(i + 1, n)
	for i in range(n - 1):
		print(i + 1, i + 2)


n = int(input())
if n <= 5:
	print(-1)
else:
	n3 = (n - 1) // 2
	n2 = n - n3 - 1
	for i in range(n2):
		print(1, i + 2)
	for i in range(n3):
		print(2, i + n2 + 2)
for i in range(n - 1):
	print(1, i + 2)


n = int(input())
if n <= 5:
	print(-1)
elif n % 2 == 0:
	print(1, 2)
	print(2, 3)
	print(2, 4)
	print(4, 5)
	print(4, 6)
	if n > 6:
		print(1, 7)
		for i in range(n - 7):
			print(i + 7, i + 8)
else:
	print(1, 2)
	print(2, 3)
	print(2, 4)
	print(2, 5)
	print(4, 6)
	print(4, 7)
	if n > 7:
		print(1, 8)
		for i in range(n - 8):
			print(i + 8, i + 9)
for i in range(n - 1):
	print(1, i + 2)


a = int(input())
if a <= 5:
	print(-1)
else:
	print('1 2')
	print('2 3')
	print('2 4')
	print('4 5')
	for i in range(6, a + 1):
		print('4 ' + str(i))
for i in range(1, a):
	print(str(i) + ' ' + str(i + 1))


import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
import collections
from itertools import permutations
from collections import defaultdict
from collections import deque
import threading
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD
n = int(input())
if n < 6:
	print(-1)
else:
	for i in range(2, 5):
		print(1, i)
	for i in range(5, n + 1):
		print(2, i)
for i in range(2, n + 1):
	print(1, i)


n = int(input())
if n < 6:
	print('-1')
else:
	res = []
	for i in range(0, n - 1):
		if i % 2 == 0:
			first = '1'
		else:
			first = '2'
		res.append('%s %s' % (first, str(i + 2)))
	print('\n'.join(res))
for i in range(0, n - 1):
	print('1 %s' % str(i + 2))


import sys
import math
import collections
dy = [1, 0, -1, 0]
dx = [0, 1, 0, -1]
r = sys.stdin.readline
N = int(r())
if N >= 6:
	print(1, 2)
	for i in range(3, N + 1):
		if i % 2 == 1:
			print(1, i)
		else:
			print(2, i)
else:
	print(-1)
for i in range(1, N):
	print(i, i + 1)


n = int(input())
if n < 6:
	print(-1)
else:
	print('1 2')
	print('1 3')
	print('1 4')
	for k in range(5, n + 1):
		print('2 ' + str(k))
for m in range(1, n):
	print(str(m) + ' ' + str(m + 1))


import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcdefghijklmnopqrstuvwxyz'
MOD = 1000000007

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
n = Int()
if n <= 5:
	print(-1)
else:
	print(1, 2)
	print(1, 3)
	print(1, 4)
	for i in range(5, n + 1):
		print(2, i)
for i in range(2, n + 1):
	print(1, i)


s = input()
n = int(s)
output = []
if n > 5:
	output.append('1 2')
	for i in range(3, (n + 1) // 2 + 2):
		output.append('1 {}'.format(i))
	for i in range((n + 1) // 2 + 2, n + 1):
		output.append('2 {}'.format(i))
else:
	output.append('-1')
for i in range(2, n + 1):
	output.append('1 {}'.format(i))
print('\n'.join(output))


n = int(input())
if n < 6:
	print(-1)
else:
	print('1 2\n2 3\n2 4\n4 5\n4 6')
	for i in range(0, (n - 6) // 2 * 2, 2):
		print(1, i + 7)
		print(i + 7, i + 8)
	if n % 2 == 1:
		print(2, n)
for i in range(n - 1):
	print(i + 1, i + 2)


def wr(n):
	if n <= 5:
		print(-1)
		return
	print(1, 2)
	print(2, 3)
	print(2, 4)
	print(5, 1)
	print(6, 1)
	x = 7
	while x <= n:
		print(1, x)
		x += 1

def cr(n):
	x = 2
	while x <= n:
		print(1, x)
		x += 1
n = int(input())
wr(n)
cr(n)


import sys
input = sys.stdin.readline
from collections import defaultdict as dc
from collections import Counter
from bisect import bisect_right, bisect_left
import math
from operator import itemgetter
from heapq import heapify, heappop, heappush
from queue import PriorityQueue as pq
n = int(input())
if n <= 5:
	print(-1)
else:
	for i in range(2, 5):
		print(1, i)
	for i in range(5, n + 1):
		print(2, i)
for i in range(2, n + 1):
	print(1, i)


import atexit, io, sys, collections, math, heapq, fractions, copy, os, functools
import sys
import random
import collections
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def f(n):
	if n <= 5:
		print(-1)
		return
	print(1, 2)
	print(1, 3)
	print(1, 4)
	print(2, 5)
	for u in range(6, n + 1):
		print(2, u)
	return
n = int(input())
f(n)
for u in range(1, n):
	print(u, u + 1)


n = int(input())
if n < 6:
	print(-1)
	[print(1, i) for i in range(2, n + 1)]
	exit()
[print(1, i) for i in range(2, 5)]
[print(2, i) for i in range(5, n + 1)]
[print(1, i) for i in range(2, n + 1)]


def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())
n = ii()
if n < 6:
	print(-1)
else:
	t = ['1 2', '1 3', '1 4', '2 5', '2 6']
	for i in range(7, n + 1):
		t.append('1 ' + str(i))
	print('\n'.join(t))
t = []
for i in range(2, n + 1):
	t.append('1 ' + str(i))
print('\n'.join(t))


n = int(input())

def print_correct(n):
	for i in range(2, n + 1):
		print('1 ' + str(i))

def print_incorrect(n):
	if n >= 6:
		print('1 2')
		print('2 3')
		print('2 4')
		for i in range(5, n + 1):
			print('1 ' + str(i))
	else:
		print('-1')
print_incorrect(n)
print_correct(n)


import sys
input = sys.stdin.readline
n = int(input())
if n < 6:
	print(-1)
else:
	l = []
	o = []
	x = (3 + n) // 2
	for i in range(3, x + 1):
		l.append((1, i))
	for i in range(x + 1, n + 1):
		o.append((2, i))
	sys.stdout.write('1' + ' ' + '2' + '\n')
	for x in l:
		sys.stdout.write(str(x[0]) + ' ' + str(x[1]) + '\n')
	for x in o:
		sys.stdout.write(str(x[0]) + ' ' + str(x[1]) + '\n')
sys.stdout.write('1' + ' ' + '2' + '\n')
p = 2
for i in range(3, n + 1):
	sys.stdout.write(str(p) + ' ' + str(i) + '\n')
	p = i


import math
import heapq
from queue import Queue

def main(n):
	if n < 6:
		print(-1)
	else:
		print(1, 2)
		print(2, 3)
		print(2, 4)
		print(4, 5)
		print(4, 6)
		a = 7
		while a <= n:
			print(2, a)
			a += 1
	a = 2
	while a <= n:
		print(1, a)
		a += 1
	return
n = int(input())
main(n)


import sys
import math
input = sys.stdin.readline

def inp():
	return int(input())

def inara():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
n = inp()
if n <= 5:
	print(-1)
else:
	for i in range(2, 5):
		print(str(1) + ' ' + str(i))
	for i in range(5, n + 1):
		print(str(2) + ' ' + str(i))
for i in range(2, n + 1):
	print(str(1) + ' ' + str(i))