Leo Jr. draws pictures in his notebook with checkered sheets (that is, each sheet has a regular square grid printed on it). We can assume that the sheets are infinitely large in any direction.

To draw a picture, Leo Jr. colors some of the cells on a sheet gray. He considers the resulting picture beautiful if the following conditions are satisfied:



 The picture is connected, that is, it is possible to get from any gray cell to any other by following a chain of gray cells, with each pair of adjacent cells in the path being neighbours (that is, sharing a side).

 Each gray cell has an even number of gray neighbours.

 There are exactly $n$ gray cells with all gray neighbours. The number of other gray cells can be arbitrary (but reasonable, so that they can all be listed).

Leo Jr. is now struggling to draw a beautiful picture with a particular choice of $n$. Help him, and provide any example of a beautiful picture.

To output cell coordinates in your answer, assume that the sheet is provided with a Cartesian coordinate system such that one of the cells is chosen to be the origin $(0, 0)$, axes $0x$ and $0y$ are orthogonal and parallel to grid lines, and a unit step along any axis in any direction takes you to a neighbouring cell.


-----Input-----

The only line contains a single integer $n$ ($1 \leq n \leq 500$) — the number of gray cells with all gray neighbours in a beautiful picture.


-----Output-----

In the first line, print a single integer $k$ — the number of gray cells in your picture. For technical reasons, $k$ should not exceed $5 \cdot 10^5$.

Each of the following $k$ lines should contain two integers — coordinates of a gray cell in your picture. All listed cells should be distinct, and the picture should satisdfy all the properties listed above. All coordinates should not exceed $10^9$ by absolute value.

One can show that there exists an answer satisfying all requirements with a small enough $k$.


-----Example-----
Input
4

Output
12
1 0
2 0
0 1
1 1
2 1
3 1
0 2
1 2
2 2
3 2
1 3
2 3



-----Note-----

The answer for the sample is pictured below:

 [Image]

Difficulty: MEDIUM
Tags: Constructive algorithms

Starter code:

Solutions:
from os import path
import sys
from functools import cmp_to_key as ctk
from collections import deque, defaultdict as dd
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from itertools import permutations
from datetime import datetime
from math import ceil, sqrt, log, gcd

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

def si():
	return input()

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

def li():
	return list(mi())
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def bo(i):
	return ord(i) - ord('a')

def solve():
	k = ii()
	x = [[0, 0], [1, 0], [0, 1], [1, 1], [2, 1], [1, 2], [2, 2]]
	for i in range(2, k + 1):
		x.append([i + 1, i])
		x.append([i, i + 1])
		x.append([i + 1, i + 1])
	print(len(x))
	for i in x:
		print(*i)
solve()


import os
import sys
from io import BytesIO, IOBase

def main():
	n = int(input())
	a = []
	a.extend([(0, 0), (1, 0)])
	for i in range(1, n + 1):
		a.extend([(i - 1, i), (i, i), (i + 1, i)])
	a.extend([(n + 1, n + 1), (n, n + 1)])
	print(len(a))
	for v in a:
		print(v[0], v[1])
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')
main()


import sys
import math
import heapq
import collections

def inputnum():
	return int(input())

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

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

def inputstring():
	return [x for x in input()]

def inputmatrixchar(rows):
	arr2d = [[j for j in input().strip()] for i in range(rows)]
	return arr2d

def inputmatrixint(rows):
	arr2d = []
	for _ in range(rows):
		arr2d.append([int(i) for i in input().split()])
	return arr2d
n = inputnum()
print(3 * n + 4)
for i in range(0, n + 2):
	print(i, i)
for i in range(0, n + 1):
	print(i, i + 1)
	print(i + 1, i)


import math
import sys
from itertools import permutations
input = sys.stdin.readline
n = int(input())
ans = [[0, 0]]

def ins(cur):
	ans.append([cur + 1, cur])
	ans.append([cur + 2, cur])
	ans.append([cur, cur + 1])
	ans.append([cur, cur + 2])
	ans.append([cur + 1, cur + 2])
	ans.append([cur + 2, cur + 1])
	ans.append([cur + 2, cur + 2])
ins(0)
for i in range(n):
	ins(2 * (i + 1))
print(len(ans))
for i in range(len(ans)):
	print(*ans[i])


n = int(input())
print(3 * n + 4)
for i in range(n + 1):
	print(i, n - i + 1)
	print(i + 1, n - i + 1)
	print(i, n - i)
print(n + 1, 0)


def painting(n):
	print(3 * n + 4)
	x = y = 0
	while x < n + 2 and y < n + 2:
		print(x, y)
		if (x, y) != (n + 1, n + 1):
			print(x + 1, y)
			print(x, y + 1)
		x += 1
		y += 1
	return
n = int(input())
painting(n)


def help():
	n = int(input())
	print(4 + n * 3)
	a = 100000
	b = 100000
	print(a - 1, b)
	print(a - 1, b + 1)
	for i in range(n):
		print(a, b - 1)
		print(a, b)
		print(a, b + 1)
		a += 1
		b -= 1
	print(a, b)
	print(a, b + 1)
help()


n = int(input())
num = 4 + n * 3
print(num)
for i in range(n + 2):
	for j in range(n + 2):
		if abs(i - j) <= 1:
			print(str(i) + ' ' + str(j))


import sys
pprint = lambda s: print(' '.join(map(str, s)))
input = lambda : sys.stdin.readline().strip()
ipnut = input
n = int(input())
print(4 + 3 * n)
print(0, 0)
print(0, 1)
print(1, 0)
print(1, 1)
print(2, 1)
print(1, 2)
print(2, 2)
for i in range(n - 1):
	print(i + 2, i + 3)
	print(i + 3, i + 2)
	print(i + 3, i + 3)


from collections import *
from math import *

def get_input_array(element_data_type):
	arr = list(map(element_data_type, input().split()))
	return arr

def solve():
	k = int(input())
	ans = set()
	ans.add((0, 0))
	ans.add((0, 1))
	ptr = 0
	for r in range(1, k + 1):
		for j in range(ptr, ptr + 3):
			ans.add((r, j))
		ptr += 1
	ans.add((k + 1, ptr))
	ans.add((k + 1, ptr + 1))
	print(len(ans))
	for (x, y) in ans:
		print(x, y)
solve()


n = int(input())
cells = 7 + 3 * (n - 1)
print(cells)
for i in range(n + 1):
	print('{} {}'.format(i, i))
	print('{} {}'.format(i + 1, i))
	print('{} {}'.format(i, i + 1))
print('{} {}'.format(n + 1, n + 1))


from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
	return int(input())

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

def solve():
	n = ri()
	k = 7 + 3 * (n - 1)
	print(k)
	print(0, 0)
	print(0, 1)
	for i in range(1, n + 1):
		print(i, i - 1)
		print(i, i)
		print(i, i + 1)
	print(n + 1, n)
	print(n + 1, n + 1)
mode = 's'
if mode == 'T':
	t = ri()
	for i in range(t):
		solve()
else:
	solve()


def func():
	n = int(input())
	m = 0
	res = []
	print(n * 3 + 4)
	print(0, 0)
	print(1, 0)
	print(0, 1)
	for i in range(n):
		block = [(1 + m, 1 + m), (2 + m, 1 + m), (1 + m, 2 + m)]
		for j in range(len(block)):
			print(block[j][0], block[j][-1])
		m += 1
	print(m + 1, m + 1)
func()


n = int(input())
delta = [[0] * (n + 2) for i in range(n + 2)]
start = 0
count = 0
for i in range(n + 2):
	if i == 0 or i == n + 1:
		limit = 2
	else:
		limit = 3
	for j in range(start, start + limit):
		count += 1
		delta[i][j] = 1
	if i == 0:
		continue
	else:
		start += 1
print(count)
for i in range(n + 2):
	for j in range(n + 2):
		if delta[i][j] == 1:
			print(i, j)


n = int(input())
k = n * 3 + 4
print(k)
print(0, 0)
print(0, 1)
skip = 0
for i in range(n):
	for j in range(skip, 3 + skip):
		print(i + 1, j)
	skip += 1
print(n + 1, skip)
print(n + 1, skip + 1)


import sys
input = sys.stdin.readline
import heapq
import copy
import math
import decimal

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

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

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

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

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

def pr_list(a):
	print(*a, sep=' ')

def main():
	tests = 1
	mod = 1000000007
	limit = 10 ** 18
	ans = 0
	for test in range(tests):
		n = inp()
		k = 7 + (n - 1) * 3
		print(k)
		pr_list([0, 0])
		pr_list([0, 1])
		pr_list([1, 0])
		pr_list([1, 1])
		for i in range(1, n + 1):
			pr_list([i, i + 1])
			pr_list([i + 1, i + 1])
			pr_list([i + 1, i])
main()


n = int(input())
diag = 1
print(4 + 3 * n)
print('0 0')
print('0 1')
print('1 0')
print('1 1')
for _ in range(n):
	print(1 + diag, diag)
	print(diag, 1 + diag)
	print(1 + diag, 1 + diag)
	diag += 1


no = int(input())
print(4 + no * 3)
print('1 0\n0 1\n1 1\n0 0')
for i in range(1, no + 1):
	print(i, i + 1)
	print(i + 1, i)
	print(i + 1, i + 1)


n = int(input())
arr = [[0, 0], [0, 1], [1, 0]]
i = 1
while i <= n:
	arr.append([i, i])
	arr.append([i, i + 1])
	arr.append([i + 1, i])
	i += 1
arr.append([i, i])
print(len(arr))
for i in arr:
	print(i[0], i[1])


n = int(input())
print(7 * n)
for i in range(1, n + 1):
	print(2 * i - 1, 0)
print(0, 0)
print(0, 1)
print(1, 1)
for i in range(1, n):
	print(2 * i, 0)
	if i % 2 == 0:
		print(2 * i - 1, 1)
		print(2 * i + 1, 1)
		print(2 * i - 1, 2)
		print(2 * i, 2)
		print(2 * i + 1, 2)
	else:
		print(2 * i - 1, -1)
		print(2 * i + 1, -1)
		print(2 * i - 1, -2)
		print(2 * i, -2)
		print(2 * i + 1, -2)
print(2 * n, 0)
if n % 2 == 0:
	print(2 * n - 1, 1)
	print(2 * n, 1)
else:
	print(2 * n - 1, -1)
	print(2 * n, -1)


n = int(input())
print(4 + 3 * n)
print(0, 0)
print(1, 0)
count = 1
while n > 0:
	print(count - 1, count)
	print(count, count)
	print(count + 1, count)
	n = n - 1
	count = count + 1
print(count - 1, count)
print(count, count)


def prog():
	n = int(input())
	coordinates = ['0 0', '0 1']
	for i in range(1, n + 1):
		for j in range(i - 1, i + 2):
			coordinates.append(str(i) + ' ' + str(j))
	coordinates.extend([str(n + 1) + ' ' + str(n), str(n + 1) + ' ' + str(n + 1)])
	print(3 * n + 4)
	print('\n'.join(coordinates) + '\n')
prog()


def read_int():
	return int(input())
n = read_int()
a = [(i, i + 1) for i in range(n + 1)]
b = [(i, i) for i in range(n + 2)]
c = [(i + 1, i) for i in range(n + 1)]
s = a + b + c
print(len(s))
print('\n'.join([str(x[0]) + ' ' + str(x[1]) for x in s]))


k = int(input())
(n, l) = (k + 2, [])
for i in range(n):
	for j in range(i - 1, i + 2):
		if j < 0 or j >= n:
			continue
		else:
			l.append([i, j])
print(len(l))
for i in l:
	print(str(i[0]) + ' ' + str(i[1]))


n = int(input())
arr = []
arr.append((0, 0))
arr.append((0, 1))
arr.append((1, 0))
arr.append((1, 1))
for i in range(n):
	a = arr[-1][0]
	b = arr[-1][1]
	arr.append((a + 1, b))
	arr.append((a, b + 1))
	arr.append((a + 1, b + 1))
print(len(arr))
for i in arr:
	print(i[0], i[1])


n = int(input())
ans = []
ans.append([0, 0])
ans.append([0, 1])
j = 0
for i in range(1, n + 1):
	ans.append([i, j])
	ans.append([i, j + 1])
	ans.append([i, j + 2])
	j += 1
ans.append([n + 1, j])
ans.append([n + 1, j + 1])
print(len(ans))
for i in ans:
	print(i[0], i[1])


k = int(input())
print(4 + 3 * k)
print(0, 0)
print(1, 0)
print(0, 1)
for i in range(k):
	print(i + 1, i + 1)
	print(i + 2, i + 1)
	print(i + 1, i + 2)
print(k + 1, k + 1)


n = int(input())
ans = 7 + 3 * (n - 1)
print(ans)
print(0, 0)
print(-1, -1)
print(-1, 0)
print(0, -1)
print(1, 0)
print(0, 1)
print(1, 1)
for j in range(n - 1):
	print(j + 2, j + 2)
	print(j + 2, j + 1)
	print(j + 1, j + 2)


n = int(input())
res = 7 + (n - 1) * 3
print(res)
print('0 0')
print('1 0')
print('0 1')
print('1 1')
print('2 1')
print('1 2')
print('2 2')
last = 2
for i in range(n - 1):
	print(str(last + 1) + ' ' + str(last))
	print(str(last) + ' ' + str(last + 1))
	print(str(last + 1) + ' ' + str(last + 1))
	last += 1


n = int(input())
print(7 + (n - 1) * 3)
print('0 0', '0 1', '1 0', '1 1', '2 1', '1 2', '2 2', sep='\n')
n -= 1
x = 2
y = 2
while n:
	print(x + 1, y)
	print(x, y + 1)
	print(x + 1, y + 1)
	x += 1
	y += 1
	n -= 1


n = int(input().strip())
print(15 + 3 * (n - 1))
print(0, 0)
print(-1, 0)
print(-2, 0)
print(-2, -1)
print(-2, -2)
print(-1, -2)
print(0, -2)
print(0, -1)
for j in range(n - 1):
	print(j + 1, j + 1)
	print(j + 1, j)
	print(j, j + 1)
print(n, n - 1)
print(n + 1, n - 1)
print(n + 1, n)
print(n + 1, n + 1)
print(n, n + 1)
print(n - 1, n + 1)
print(n - 1, n)


n = int(input())
start = 7
lis = [[0, 0], [0, 1], [1, 1], [1, 0], [1, 2], [2, 2], [2, 1]]
for i in range(2, n + 1):
	start += 3
	lis.append([i, i + 1])
	lis.append([i + 1, i + 1])
	lis.append([i + 1, i])
print(start)
for i in range(len(lis)):
	print(lis[i][0], end=' ')
	print(lis[i][1])


n = int(input())
if (n - 1) % 3 != 0:
	print(4 + 3 * n)
	s = [[0, 1], [1, 0], [1, 1]]
	print(0, 0)
	for i in range(n + 1):
		for (x, y) in s:
			print(x + i, y + i)
else:
	n -= 1
	n //= 3
	print(2 + 5 + n * 5)
	print('0 1')
	print('1 0')
	s = [[1, 1], [2, 1], [1, 2], [0, 2], [2, 0]]
	for i in range(n + 1):
		for (x, y) in s:
			print(x + i, y + i)


import sys
input = sys.stdin.readline
n = int(input())
ANS = [(0, 0), (0, 1), (1, 0), (1, 1)]
for i in range(n):
	ANS.append((i + 1, i + 2))
	ANS.append((i + 2, i + 1))
	ANS.append((i + 2, i + 2))
print(len(ANS))
for (x, y) in ANS:
	print(x, y)


from collections import defaultdict
n = int(input())
d = defaultdict(list)
k = n + 2
l = []
for i in range(k):
	for j in range(i - 1, i + 2):
		if j >= 0 and j < k:
			d[i, j] = True
print(len(d))
for ele in d:
	print(ele[0], ele[1])


n = int(input())
print(11 * n)
c = 0
x = y = 0
while True:
	print(x, y)
	if y == -2 * n:
		break
	if c % 4 < 2:
		x += 1
	else:
		y -= 1
	c += 1
k = 0
x = 2
y = 0
while k < n:
	print(x + 1, y)
	print(x, y + 1)
	print(x + 1, y + 1)
	x += 2
	y -= 2
	k += 1
x = 0
y = -1
while x <= 2 * n - 1:
	print(x, y)
	if y > -2 * n:
		y -= 1
	else:
		x += 1


n = int(input())
k = 3 * n + 4
print(k)
for i in range(n + 2):
	if i == 0:
		print(0, 0)
		print(1, 0)
	elif i == n + 1:
		print(n, n + 1)
		print(n + 1, n + 1)
	else:
		print(i - 1, i)
		print(i, i)
		print(i + 1, i)


from collections import Counter
from collections import defaultdict
from collections import deque
import math
import sys
input = sys.stdin.readline
import bisect
rs = lambda : input().strip()
ri = lambda : int(input())
rl = lambda : list(map(int, input().strip().split()))
rls = lambda : list(map(str, input().split()))
n = int(input())
x = 4
y = 4
print(7 + (n - 1) * 3)
print(x, y)
print(x, y + 1)
print(x - 1, y)
print(x - 1, y + 1)
print(x - 1, y + 2)
print(x - 2, y + 1)
print(x - 2, y + 2)
(x, y) = (x - 2, y + 2)
n = n - 1
while n > 0:
	print(x - 1, y)
	print(x, y + 1)
	print(x - 1, y + 1)
	(x, y) = (x - 1, y + 1)
	n = n - 1


n = int(input())
print(3 * n + 4)
print(0, 0)
print(0, 1)
print(1, 0)
print(1, 1)
fromm = 2
to = n + 2
for coord in range(fromm, to):
	print(coord, coord)
	print(coord, coord - 1)
	print(coord - 1, coord)


n = int(input())
print(7 + (n - 1) * 3)
print(0, 0)
print(1, 0)
print(0, 1)
print(1, 1)
for i in range(n):
	print(i + 1, i + 2)
	print(i + 2, i + 1)
	print(i + 2, i + 2)


a = int(input())
print(4 + a * 3)
print(0, 0)
for i in range(a + 1):
	print(i + 1, i)
	print(i, i + 1)
	print(i + 1, i + 1)


import sys
k = int(sys.stdin.readline())
x = 500000
y = 500000
v = []
v.append([x, y])
v.append([x + 1, y])
v.append([x, y - 1])
v.append([x + 1, y - 1])
x += 1
y -= 1
while k:
	v.append([x + 1, y])
	v.append([x, y - 1])
	v.append([x + 1, y - 1])
	x += 1
	y -= 1
	k -= 1
print(len(v))
for i in v:
	print(*i)


import sys
ints = (int(x) for x in sys.stdin.read().split())
sys.setrecursionlimit(3000)

def main():
	n = next(ints)
	print(17 * n + 12)
	fig = [[1, 5], [1, 2, 3, 5], [3, 5], [0, 1, 3, 5], [0, 1, 2, 3, 5]]
	fig = [(i, j) for (i, l) in enumerate(fig) for j in l]
	for i in (0, 2 + 5 * n):
		for j in [1, 2, 3, 4, 5]:
			print(i, j)
	print(1 + 5 * n, 1)
	print(1 + 5 * n, 5)
	for k in range(n):
		I = 1 + 5 * k
		for (i, j) in fig:
			print(I + i, j)
	return
main()


n = int(input())
print((n + 1) * 3 + 1)
for i in range(n + 1):
	print(i, i)
	print(i + 1, i)
	print(i, i + 1)
print(i + 1, i + 1)


n = int(input())
print(4 + n * 3)
print('0 0')
print('1 0')
arr = [[0, 1], [1, 1], [2, 1]]
for i in range(n):
	for j in range(3):
		print(str(arr[j][0]) + ' ' + str(arr[j][1]))
		arr[j][1] += 1
		arr[j][0] += 1
for j in range(2):
	print(str(arr[j][0]) + ' ' + str(arr[j][1]))


import sys
import io, os
n = int(input())
l = []
l.append([0, 0])
l.append([1, 0])
for i in range(1, n + 1):
	l.append([i - 1, i])
	l.append([i, i])
	l.append([i + 1, i])
l.append([n, n + 1])
l.append([n + 1, n + 1])
print(len(l))
for i in l:
	print(*i)


n = int(input())
(x, y) = (0, 0)
print(2 + 3 * n + 2)
print(x, y)
print(x, y - 1)
x += 1
for i in range(n):
	print(x, y)
	print(x, y - 1)
	print(x, y - 2)
	x += 1
	y -= 1
print(x, y)
print(x, y - 1)


n = int(input())
xy = []
(dx, dy) = ([1, -1, 0, 0], [0, 0, 1, -1])
for i in range(1, n + 1):
	xy.append((i, i))
s = set(xy)
for i in xy:
	(x, y) = i
	for j in range(4):
		s.add((x + dx[j], y + dy[j]))
s.add((0, 0))
s.add((n + 1, n + 1))
print(len(s))
for i in list(s):
	print(*i)


N = int(input())
if N & 1:
	X = 3 + 3 * (N // 2) + (2 + N // 2 * 2) + 5 + (N - 1) * 2 + N + 1 + 3 + 3 * (N // 2)
	print(int(X))
	count = 0
	for i in range(int(N // 2) + 1):
		print(0, count)
		count += 1
		print(0, count)
		count += 1
		print(0, count)
		count += 2
	for i in range(0, (N + 1) * 2, 2):
		print(1, i)
	for i in range(N * 2 + 3):
		print(2, i)
	for i in range(2, N * 2 + 2 + 1, 2):
		print(3, i)
	count = 2
	for i in range(int(N // 2) + 1):
		print(4, count)
		count += 1
		print(4, count)
		count += 1
		print(4, count)
		count += 2
else:
	X = (N // 2 + 1) * 3 + (2 + N) + N * 2 + 3 + N + (N + N / 2)
	print(int(X))
	count = 0
	for i in range(int(N // 2) + 1):
		print(0, count)
		count += 1
		print(0, count)
		count += 1
		print(0, count)
		count += 2
	for i in range(0, (N + 1) * 2 + 1, 2):
		print(1, i)
	for i in range(N * 2 + 3):
		print(2, i)
	for i in range(2, N * 2 + 1, 2):
		print(3, i)
	count = 2
	for i in range(int(N // 2)):
		print(4, count)
		count += 1
		print(4, count)
		count += 1
		print(4, count)
		count += 2


n = int(input())
k = 7 + (n - 1) * 3
print(k)
for i in range(n + 1):
	print(i, i)
	print(i + 1, i)
	print(i, i + 1)
print(n + 1, n + 1)


from sys import stdin, stdout
z = int(stdin.readline())
print(3 * z + 4)
print(0, 0)
print(1, 0)
print(1, 1)
print(0, 1)
print(1, 2)
print(2, 1)
(x, y) = (2, 2)
for i in range(z - 1):
	print(x, y)
	print(x + 1, y)
	print(x, y + 1)
	x += 1
	y += 1
print(x, y)


k = int(input())
print(k * 3 + 4)
for i in range(k + 1):
	print(i, i)
	print(i + 1, i)
	print(i, i + 1)
print(i + 1, i + 1)


n = int(input())
ans = [[0, 0], [1, 0], [0, 1]]
for i in range(1, n + 1):
	ans.append([i, i])
	ans.append([i + 1, i])
	ans.append([i, i + 1])
ans.append([n + 1, n + 1])
print(n * 3 + 4)
for it in ans:
	print(*it)


n = int(input())
h = 3 + (n - 1)
mat = []
arr = []
for i in range(h):
	for j in range(h):
		arr.append(0)
	mat.append(arr)
	arr = []
for i in range(n):
	j = n - i - 1
	while j >= 0:
		mat[i][j] = 1
		j = j - 1
for i in range(h - 1, 1, -1):
	j = h - 1
	while j > h - i:
		mat[i][j] = 1
		j = j - 1
print(n * 3 + 4)
for i in range(h):
	for j in range(h):
		if mat[i][j] == 0:
			print(i, j)


s = list()
import math
n = int(input())
x = 0
y = 0
for i in range(n + 1):
	s.append((x, y))
	s.append((x - 1, y))
	s.append((x, y + 1))
	x = x - 1
	y = y + 1
s.append((x, y))
print(len(s))
for i in s:
	print(*i)


import sys
input = sys.stdin.readline
import math

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

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

def insr():
	s = input().strip()
	return list(s[:len(s)])

def invr():
	return map(int, input().strip().split())

def from_file(f):
	return f.readline

def solve(n):
	res = [(0, 0), (1, 0), (0, 1), (1, 1)]
	(si, sj) = (1, 1)
	for i in range(n):
		res.append((si + 1, sj))
		res.append((si, sj + 1))
		res.append((si + 1, sj + 1))
		(si, sj) = (si + 1, sj + 1)
	return res
n = inp()
res = solve(n)
print(len(res))
for (a, b) in res:
	print(f'{a} {b}')


from sys import *
setrecursionlimit(100000000)
input = stdin.readline
lmi = lambda : list(map(int, input().split()))
mi = lambda : map(int, input().split())
si = lambda : input().strip('\n')
ssi = lambda : input().strip('\n').split()
n = int(input())
print(n + 2 * n + 4)
for i in range(0, n + 2):
	print(i, i)
for i in range(1, n + 2):
	print(i, i - 1)
for i in range(0, n + 1):
	print(i, i + 1)


from sys import stdin, stdout
n = int(stdin.readline())
ans = []
for i in range(0, n + 2):
	ans.append([i, i])
for i in range(1, len(ans)):
	k = ans[i]
	ans.append([k[0] - 1, k[1]])
	ans.append([k[0], k[1] - 1])
print(len(ans))
for i in ans:
	print(*i)


n = int(input())
s = (n + 1) * 3 + 1
print(s)
print(0, 0)
c = 0
(x, y) = (1, 1)
(p, q) = (0, 1)
(u, v) = (1, 0)
while c != n + 1:
	c += 1
	print(x, y)
	print(p, q)
	print(u, v)
	x += 1
	y += 1
	p += 1
	q += 1
	u += 1
	v += 1


n = int(input())
print(3 * n + 4)
print(0, 0)
for x in range(n + 1):
	print(x + 1, x)
	print(x + 1, x + 1)
	print(x, x + 1)


n = int(input())
set1 = set()

def task(x):
	global set1
	set1.add((x, x))
	set1.add((x + 1, x))
	set1.add((x, x + 1))
	set1.add((x + 1, x + 1))
pos = 0
for i in range(n + 1):
	task(pos)
	pos += 1
set1 = sorted(set1)
print(len(set1))
for value in set1:
	print(value[0], value[1])


from sys import exit, stdin, stderr

def rl():
	return [int(w) for w in stdin.readline().split()]
(n,) = rl()
print(7 * n + 8)
print(0, 0)
for i in range(n + 1):
	print(2 * i + 1, 2 * i)
	print(2 * i + 2, 2 * i)
	print(2 * i + 2, 2 * i + 1)
	print(2 * i + 2, 2 * i + 2)
	print(2 * i + 1, 2 * i + 2)
	print(2 * i, 2 * i + 2)
	print(2 * i, 2 * i + 1)


n = int(input())
xy = []
for i in range(n + 2):
	if i - 1 >= 0:
		xy.append([i, i - 1])
	xy.append([i, i])
	if i + 1 <= n + 1:
		xy.append([i, i + 1])
print(len(xy))
for (x, y) in xy:
	print(x, y)


import sys
import math
read = lambda : sys.stdin.readline()
n = int(read())
if n == 1:
	print(15)
	print('-2 0\n-1 0\n0 0\n1 0\n2 0\n-2 1\n0 1\n0 -1\n2 -1\n-2 2\n-1 2\n0 2\n0 -2\n1 -2\n2 -2')
else:
	coords = []
	x = 0
	while n > 1:
		for i in range(3):
			coords.append((x, 0))
			if x % 3 != 0:
				coords.append((x, 1))
				coords.append((x, -1))
				n -= 1
			x += 1
	if n == 1:
		coords.append((x, 0))
		x += 1
		coords.append((x, 0))
		coords.append((x, 1))
		coords.append((x, -1))
		coords.append((x, 2))
		x += 1
		coords.append((x, 0))
		coords.append((x, -1))
		coords.append((x, 2))
		x += 1
		coords.append((x, 2))
		x += 1
		coords.append((x, 2))
		coords.append((x, 1))
	coords.append((x, 0))
	x += 1
	coords.append((-1, 0))
	coords.append((-1, -1))
	coords.append((-1, -2))
	coords.append((x, 0))
	coords.append((x, -1))
	coords.append((x, -2))
	for y in range(-1, x + 1):
		coords.append((y, -3))
	print(len(coords))
	for c in coords:
		print(c[0], c[1])


import sys
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
(n,) = I()
an = [[0, 0], [1, 0], [0, 1], [1, 1]]
i = 1
x = 1
while x < n + 1:
	an.append([i, i + 1])
	an.append([i + 1, i])
	an.append([i + 1, i + 1])
	i += 1
	x += 1
print(len(an))
for i in range(len(an)):
	print(*an[i])


n = int(input())
k = 3 * n + 4
print(k)
am = 0
print(0, 0)
print(0, 1)
for i in range(1, n + 1):
	for j in range(n + 2):
		if j >= i - 1 and j - i + 1 < 3:
			print(i, j)
print(n + 1, n)
print(n + 1, n + 1)


import sys
input = sys.stdin.readline
n = int(input())
solo = set()
other = set()
for i in range(n):
	solo.add((i, i))
for i in solo:
	x = i[0]
	other.add((x + 1, x))
	other.add((x, x + 1))
	other.add((x - 1, x))
	other.add((x, x - 1))
solo |= other
solo.add((-1, -1))
solo.add((n, n))
print(len(solo))
for i in solo:
	print(*i)


import sys, math, os
from io import BytesIO, IOBase
from collections import defaultdict as dd, deque, Counter

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

def mdata():
	return list(map(int, data().split()))

def outl(var):
	sys.stdout.write(' '.join(map(str, var)) + '\n')

def out(var):
	sys.stdout.write(str(var) + '\n')
mod = 998244353
k = int(data())
out(3 * k + 4)
ans = ['0 0']
for i in range(k + 1):
	ans.append(str(i) + ' ' + str(i + 1))
	ans.append(str(i + 1) + ' ' + str(i))
	ans.append(str(i + 1) + ' ' + str(i + 1))
out('\n'.join(ans))


n = int(input())
x = 1
y = 1
ans = []
ans.append((0, 0))
ans.append((0, 1))
ans.append((1, 0))
ans.append((1, 1))
for i in range(n):
	ans.append((x + 1, y))
	ans.append((x, y + 1))
	x += 1
	y += 1
	ans.append((x, y))
print(len(ans))
for i in ans:
	print(i[0], i[1])


def getint():
	return int(input())

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

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

def getstring():
	return input()
n = getint()
ans = 3 * (n + 1) + 1
print(ans)
(x, y) = (0, 0)
for i in range(n + 1):
	print(x, y)
	print(x + 1, y)
	print(x, y - 1)
	x += 1
	y -= 1
print(x, y)


from __future__ import division, print_function
import sys
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
import os, sys, bisect, copy
from collections import defaultdict, Counter, deque
if os.path.exists('in.txt'):
	sys.stdin = open('in.txt', 'r')
if os.path.exists('out.txt'):
	sys.stdout = open('out.txt', 'w')

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

def mapi(arg=0):
	return map(int if arg == 0 else str, input().split())
n = int(input())
res = 0
x = 0
y = 0
i = 0
print((n + 1) * 3 + 1)
print(0, 0)
for i in range(1, n + 2):
	print(i, i)
	print(i, i - 1)
	print(i - 1, i)


import sys, os, io

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

def ri():
	return int(sys.stdin.readline())

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

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math as mt

def main():
	n = ri()
	z = 1
	if n == 1:
		print(7)
		print(z, z)
		print(z - 1, z - 1)
		print(z - 1, z)
		print(z, z - 1)
		print(z + 1, z + 1)
		print(z + 1, z)
		print(z, z + 1)
	else:
		print(7 + (n - 1) * 3)
		print(z, z)
		print(z - 1, z - 1)
		print(z - 1, z)
		print(z, z - 1)
		print(z + 1, z + 1)
		print(z + 1, z)
		print(z, z + 1)
		z = 2
		for i in range(n - 1):
			print(z + 1, z + 1)
			print(z + 1, z)
			print(z, z + 1)
			z += 1

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size))
			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, size=-1):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size if size == -1 else size))
			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()

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

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

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


n = int(input())
k = 7 + (n - 1) * 3
print(k)
print('0 0')
print('1 0')
for i in range(1, 1 + n):
	for j in range(i - 1, i + 2):
		print(j, end=' ')
		print(i)
print(j - 1, end=' ')
print(i + 1)
print(j, end=' ')
print(i + 1)


am = int(input())
print(am * 3 + 4)
print(0, 0)
print(1, 0)
for i in range(am):
	for g in range(3):
		print(i + g, i + 1)
print(am, am + 1)
print(am + 1, am + 1)


def tc():
	n = int(input())
	print(4 + 3 * n)
	for i in range(2):
		for j in range(2):
			print(i, j)
	for i in range(1, n + 1):
		print(i, i + 1)
		print(i + 1, i)
		print(i + 1, i + 1)
tc()


n = int(input())
x = 0
y = 0
c = n + 2 + 2 * (n + 1)
print(c)
for i in range(n + 1):
	print(x, end=' ')
	print(y)
	print(x + 1, end=' ')
	print(y)
	print(x, end=' ')
	print(y + 1)
	x = x + 1
	y = y + 1
	c = c + 1
print(x, end=' ')
print(y)


import sys
from collections import defaultdict as dd
from collections import deque
from fractions import Fraction as f
from itertools import permutations

def eprint(*args):
	print(*args, file=sys.stderr)
zz = 1
from math import *
import copy
if zz:
	input = sys.stdin.readline
else:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('all.txt', 'w')

def li():
	return [int(x) for x in input().split()]

def fi():
	return int(input())

def si():
	return list(input().rstrip())

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

def gh():
	sys.stdout.flush()

def bo(i):
	return ord(i) - ord('a')
from copy import *
from bisect import *

def pro(f):
	c = 1
	for i in range(10):
		c *= f[i]
	return c
n = fi()
d = []
i = 0
j = 0
for p in range(n):
	d.append((i, j))
	d.append((i, j + 1))
	d.append((i + 1, j + 1))
	d.append((i + 1, j + 2))
	d.append((i + 1, j))
	d.append((i + 2, j + 1))
	d.append((i + 2, j + 2))
	i += 1
	j += 1
d = list(set(d))
print(len(d))
for i in d:
	print(*i)


n = int(input())
print(n * 2 + n + 2 + 2)
print(0, 0)
print(0, 1)
print(1, 0)
for i in range(1, n + 1):
	print(i, i)
	print(i + 1, i)
	print(i, i + 1)
print(n + 1, n + 1)


n = int(input())
se = {(0, 0)}

def nprint(x, y):
	global se
	se.add((x, y))

def rect(x, y, o):
	if o == 1:
		nprint(x, y)
		nprint(x + 1, y)
		nprint(x + 2, y)
		nprint(x, y + 1)
		nprint(x, y + 2)
		nprint(x + 2, y + 1)
		nprint(x + 2, y + 2)
		nprint(x + 1, y + 2)
	else:
		nprint(x, y)
		nprint(x + 1, y)
		nprint(x + 2, y)
		nprint(x, y - 1)
		nprint(x, y - 2)
		nprint(x + 2, y - 1)
		nprint(x + 2, y - 2)
		nprint(x + 1, y - 2)
x = 0
y = 0
ans = 0
p = 0
if n % 2 == 0:
	p = n // 2
elif n % 2 == 1 and n != 1:
	p = n // 2 + 1
else:
	p = 1
for i in range(p):
	rect(x, y, 1)
	rect(x + 2, y, -1)
	if i == 0:
		ans += 1
	else:
		ans += 2
	x += 4
if ans < n:
	nprint(0, -1)
	nprint(-1, 0)
	nprint(-1, -1)
	ans += 1
print(len(se))
for i in se:
	print(str(i[0]) + ' ' + str(i[1]))


import math, sys, bisect
from collections import defaultdict, Counter, deque
from itertools import groupby, accumulate
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
ilele = lambda : map(int, input().split())
alele = lambda : list(map(int, input().split()))

def Y(c):
	print(['NO', 'YES'][c])

def y(c):
	print(['no', 'yes'][c])
N = int(input())
print(N * 3 + 4)
print(0, 0)
for i in range(1, N + 2):
	print(i, i)
	print(i, i - 1)
	print(i - 1, i)


import sys

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

def mint():
	return int(minp())

def mints():
	return map(int, minp().split())

def solve():
	n = mint()
	print((n + 1) * 3 + 1)
	for i in range(n + 1):
		print(i, i)
		print(1 + i, i)
		print(i, 1 + i)
	print(n + 1, n + 1)
solve()


n = int(input())
s = set()
min_x = 1
min_y = 1
for i in range(n):
	s.add((min_x, min_y))
	s.add((min_x, min_y - 1))
	s.add((min_x - 1, min_y))
	s.add((min_x - 1, min_y - 1))
	s.add((min_x + 1, min_y + 1))
	s.add((min_x + 1, min_y))
	s.add((min_x, min_y + 1))
	min_x += 1
	min_y += 1
print(len(s))
for i in s:
	print(*i)


from sys import stdout

class Solve:

	def solve(self):
		n = int(input())
		ans = [str(3 * n + 4), '\n']
		for i in range(1, n + 1):
			ans += [str(i), ' ', str(i), '\n']
			ans += [str(i - 1), ' ', str(i), '\n']
			ans += [str(i), ' ', str(i - 1), '\n']
			if i == 1:
				ans += [str(i - 1), ' ', str(i - 1), '\n']
			if i == n:
				ans += [str(i + 1), ' ', str(i), '\n']
				ans += [str(i), ' ', str(i + 1), '\n']
				ans += [str(i + 1), ' ', str(i + 1), '\n']
		stdout.write(''.join(ans))

def main():
	s = Solve()
	s.solve()
main()


from sys import stdin

def iinput():
	return int(stdin.readline())

def sinput():
	return input()

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

def linput():
	return list(map(int, stdin.readline().split()))
n = iinput()
n += 1
k = 4 + (n - 1) * 3
print(k)
print(0, n - 1)
print(0, n)
j = n - 2
for i in range(1, n):
	temp = j
	for m in range(3):
		print(i, temp)
		temp += 1
	j -= 1
print(n, 0)
print(n, 1)


n = int(input())
ans = [[0, 0], [0, 1], [1, 0], [1, 1]]
p = 1
for i in range(n):
	p += 1
	ans.append([p, p])
	ans.append([p, p - 1])
	ans.append([p - 1, p])
print(len(ans))
for i in ans:
	print(*i)


n = int(input())
x = 3 * n + 4
print(x)
for i in range(2):
	if i == 0:
		for i in range(n + 2):
			print(i, i)
	else:
		for j in range(n + 1):
			print(j, j + 1)
			print(j + 1, j)


n = int(input())
print((n + 1) * 4 - n)
i = 0
j = 0
while i <= n + 1 and j <= n + 1:
	if i == n + 1 and j == n + 1:
		print(i, j)
		i = i + 1
		j = j + 1
	else:
		print(i, j)
		print(i + 1, j)
		print(i, j + 1)
		i += 1
		j += 1


import math
import sys
input = sys.stdin.readline
n = int(input())
points = [(0, -1), (-1, -1)]
for i in range(n):
	points.append((i - 1, i))
	points.append((i, i))
	points.append((i + 1, i))
points.append((n - 1, n))
points.append((n, n))
print(len(points))
print('\n'.join(map(lambda i: str(i[0]) + ' ' + str(i[1]), points)))


n = int(input())
s = 2 + n
ans = []
count = 0
for i in range(s):
	ans.append(str(i) + ' ' + str(i))
	count += 1
	if i + 1 < s:
		ans.append(str(i) + ' ' + str(i + 1))
		count += 1
	if i - 1 >= 0:
		ans.append(str(i) + ' ' + str(i - 1))
		count += 1
print(count)
for an in ans:
	print(an)


import os
import sys
from io import BytesIO, IOBase
from collections import Counter, defaultdict
from collections import deque
from functools import cmp_to_key
import math

def sin():
	return input()

def ain():
	return list(map(int, sin().split()))

def sain():
	return input().split()

def iin():
	return int(sin())
MAX = float('inf')
MIN = float('-inf')
MOD = 1000000007

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	s = set()
	for p in range(2, n + 1):
		if prime[p]:
			s.add(p)
	return s

def readTree(n, m):
	adj = [deque([]) for _ in range(n + 1)]
	for _ in range(m):
		(u, v) = ain()
		adj[u].append(v)
		adj[v].append(u)
	return adj

def solve(l, suma, k, n):
	c = 0
	xs = sum(l[0:k])
	if xs == k:
		c += 1
	for j in range(k, n):
		xs -= l[j - k]
		xs += l[j]
		if xs == k:
			c += 1
	return c

def main():
	n = iin()
	if n == 1:
		print(7)
		print(0, 0)
		print(0, 1)
		print(1, 0)
		print(1, 1)
		print(1, 2)
		print(2, 1)
		print(2, 2)
		sys.exit(0)
	if n == 2:
		print(10)
		print(0, 0)
		print(0, 1)
		print(1, 0)
		print(1, 1)
		print(1, 2)
		print(2, 1)
		print(2, 2)
		print(2, 3)
		print(3, 2)
		print(3, 3)
		sys.exit(0)
	if n == 4:
		print(2 * (n - 4) + 4 * 2 + 4)
		print(0, 1)
		print(0, 2)
		for i in range(1, n // 2 + 1):
			print(i, 0)
			print(i, 1)
			print(i, 2)
			print(i, 3)
		print(n // 2 + 1, 1)
		print(n // 2 + 1, 2)
		sys.exit(0)
	else:
		print(4 + n * 3)
		print(0, 0)
		print(0, 1)
		c = 0
		for i in range(1, n + 1):
			print(i, c)
			print(i, c + 1)
			print(i, c + 2)
			c += 1
		print(n + 1, c)
		print(n + 1, c + 1)
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')
if os.getcwd() == 'D:\\code':
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
	input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


n = int(input())
s = set()
for i in range(n):
	s.add((i - 1, i))
	s.add((i - 1, i - 1))
	s.add((i, i - 1))
	s.add((i, i))
	s.add((i, i + 1))
	s.add((i + 1, i + 1))
	s.add((i + 1, i))
print(len(s))
for (x, y) in s:
	print(x, y)


import sys
n = int(sys.stdin.readline().strip())
print(3 * (n + 1) + 1)
print('0 0')
for i in range(0, n + 1):
	print(str(i) + ' ' + str(i + 1))
	print(str(i + 1) + ' ' + str(i))
	print(str(i + 1) + ' ' + str(i + 1))


n = int(input())
print(3 * n + 4)
points = [[0, 0], [0, 1], [1, 0], [1, 1]]
for i in points:
	print(i[0], i[1])
centre = [1, 1]
for i in range(n):
	(x, y) = centre
	points = [[x, y + 1], [x + 1, y], [x + 1, y + 1]]
	for i in points:
		print(i[0], i[1])
	x += 1
	y += 1
	centre = [x, y]


n = int(input())
points = [(-2, 0), (-1, 0), (-2, -1), (-2, -2), (-1, -2), (0, -2), (0, -1), (0, 0)]
x = 0
for _ in range(n):
	points.append((x, x + 1))
	points.append((x, x + 2))
	points.append((x + 1, x + 2))
	points.append((x + 1, x))
	points.append((x + 2, x + 2))
	points.append((x + 2, x + 1))
	points.append((x + 2, x))
	x += 2
print(len(points))
for elem in points:
	print(elem[0], elem[1])


for _ in range(1):
	k = int(input())
	arr = [(0, 0), (0, 1)]
	c = [0, 0]
	for i in range(k):
		c[0] += 1
		c[1] += 1
		arr.append([c[0], c[1] - 1])
		arr.append([c[0], c[1]])
		arr.append([c[0], c[1] + 1])
	arr.append([c[0] + 1, c[1]])
	arr.append([c[0] + 1, c[1] + 1])
	print(len(arr))
	for el in arr:
		print(*el)


import sys
input = sys.stdin.readline
n = int(input())
ans = [[0, 0], [0, 1], [1, 0], [1, 1]]
for i in range(n):
	ans.append([i + 1, i + 2])
	ans.append([i + 2, i + 1])
	ans.append([i + 2, i + 2])
print(len(ans))
for i in ans:
	print(*i)


import sys

def recur_draw(n):
	if n == 1:
		print(0, 0)
		print(1, 0)
		print(0, 1)
		print(1, 1)
		print(2, 1)
		print(1, 2)
		print(2, 2)
	else:
		recur_draw(n - 1)
		print(n + 1, n)
		print(n, n + 1)
		print(n + 1, n + 1)
n = int(sys.stdin.readline())
print(7 + (n - 1) * 3)
recur_draw(n)


import io
import os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def get_str():
	return input().decode().strip()

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

def oint():
	return int(input())
n = oint()
print(n * 3 + 4)
print(0, 0)
print(1, 0)
print(0, 1)
print(1, 1)
for i in range(n):
	print(i + 1, i + 2)
	print(i + 2, i + 2)
	print(i + 2, i + 1)


asass = int(input())
zxzc = 0
y = 0
cvccc = asass + 2 + 2 * (asass + 1)
print(cvccc)
for i in range(asass + 1):
	print(zxzc, end=' ')
	print(y)
	print(zxzc + 1, end=' ')
	print(y)
	print(zxzc, end=' ')
	print(y + 1)
	zxzc = zxzc + 1
	y = y + 1
	cvccc = cvccc + 1
print(zxzc, end=' ')
print(y)


from math import *

def rr(t):
	zzz = [t(i) for i in input().split()]
	if len(zzz) == 1:
		return zzz[0]
	return zzz

def r3(t):
	return [t(i) for i in input()]
n = int(input())
cp = 1
print(4 + n * 3)
cp = 1
print(cp, 1)
print(cp, 2)
print(cp - 1, 2)
print(cp - 1, 1)
print(cp, 0)
print(cp + 1, 0)
print(cp + 1, 1)
cx = 2
cy = 0
for i in range(n - 1):
	print(cx, cy - 1)
	print(cx + 1, cy)
	print(cx + 1, cy - 1)
	cx += 1
	cy -= 1


k = int(input())
if k == 1:
	print(7)
	print(0, 0)
	print(0, 1)
	print(1, 0)
	print(1, 1)
	print(1, 2)
	print(2, 1)
	print(2, 2)
elif k == 2:
	print(10)
	print(0, 0)
	print(0, 1)
	print(1, 0)
	print(1, 1)
	print(1, 2)
	print(2, 1)
	print(2, 2)
	print(3, 2)
	print(2, 3)
	print(3, 3)
else:
	print(k * 3 + 4)
	for j in range(0, k + 1):
		print(j, j)
		print(j + 1, j)
		print(j, j + 1)
	print(j + 1, j + 1)


from sys import stdin, stdout
from math import gcd, sqrt
from collections import deque
input = stdin.readline
R = lambda : map(int, input().split())
I = lambda : int(input())
S = lambda : input().rstrip('\n')
L = lambda : list(R())
P = lambda x: stdout.write(x)
hg = lambda x, y: (y + x - 1) // x * x
pw = lambda x: 1 if x == 1 else 1 + pw(x // 2)
chk = lambda x: chk(x // 2) if not x % 2 else True if x == 1 else False
N = 10 ** 6
n = I()
print(n + 2 + (n + 1) * 2)
P('-1 0\n-1 1\n')
for i in range(n):
	for j in range(3):
		print(i, i + j)
P(str(n) + ' ' + str(n) + '\n' + str(n) + ' ' + str(n + 1))


n = int(input())
arr = [[1, 1], [0, 1], [2, 1], [1, 0], [1, 2], [0, 0], [n + 1, n + 1]]
if n == 1:
	print(len(arr))
	for i in arr:
		print(*i)
else:
	for i in range(2, n + 1):
		arr.append([i, i])
		arr.append([i + 1, i])
		arr.append([i, i + 1])
	print(len(arr))
	for i in arr:
		print(*i)


import math
import collections
from sys import stdin, stdout, setrecursionlimit
from bisect import bisect_left as bsl
from bisect import bisect_right as bsr
import heapq as hq
setrecursionlimit(2 ** 20)
t = 1
for _ in range(t):
	n = int(stdin.readline())
	k = 3 * n + 4
	print(k)
	print('0 0')
	for i in range(1, n + 2):
		print(str(i - 1) + ' ' + str(i))
		print(str(i) + ' ' + str(i - 1))
		print(str(i) + ' ' + str(i))


import math
k = int(input())
n = k
print(3 * (n + 1) + 1)
for i in range(n + 1):
	print(i, i)
	print(i + 1, i)
	print(i, i + 1)
print(n + 1, n + 1)


n = int(input())
print(1 + 3 * (n + 1))
a = 0
b = 0
print(a, b)
a += 1
b += 1
for i in range(n + 1):
	print(a, b)
	print(a - 1, b)
	print(a, b - 1)
	a += 1
	b += 1


import sys
import math
input = sys.stdin.readline()
n = int(input)
k = 7 + 3 * (n - 1)
m = 1
o = 2
print(k)
print(0, 0)
print(1, 0)
print(0, 1)
print(1, 1)
print(2, 1)
while n > 1:
	n -= 1
	print(m, o)
	print(m + 1, o)
	print(m + 2, o)
	m += 1
	o += 1
print(m, o)
print(m + 1, o)


from sys import stdin, stdout
from collections import defaultdict
import heapq
import math

def get_int():
	return int(stdin.readline().strip())

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

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

def get_string():
	return stdin.readline().strip()
INF = 10000000000.0
mod = 1000000000.0 + 7
n = get_int()
ans = [(0, 0), (0, 1), (1, 0), (1, 1)]
(x, y) = (1, 1)
for i in range(n):
	ans.append((x, y + 1))
	ans.append((x + 1, y))
	ans.append((x + 1, y + 1))
	x += 1
	y += 1
print(len(ans))
for i in ans:
	print(i[0], i[1])


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

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

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def IF(c, t, f):
	return t if c else f

def YES(c):
	return IF(c, 'YES', 'NO')

def Yes(c):
	return IF(c, 'Yes', 'No')

def main():
	t = 1
	rr = []
	for _ in range(t):
		n = I()
		r = set()
		for i in range(n + 1):
			r.add((i, i))
			r.add((i + 1, i))
			r.add((i, i + 1))
			r.add((i + 1, i + 1))
		rr.append(len(r))
		rr.append(JAA(sorted(r), '\n', ' '))
	return JA(rr, '\n')
print(main())


from sys import stdin
input = stdin.readline
n = int(input())
punkty = set()
for i in range(n + 1):
	punkty.add((2 * i, 2 * i))
	punkty.add((2 * i + 1, 2 * i))
	punkty.add((2 * i + 2, 2 * i))
	punkty.add((2 * i + 2, 2 * i + 1))
	punkty.add((2 * i + 2, 2 * i + 2))
	punkty.add((2 * i + 1, 2 * i + 2))
	punkty.add((2 * i, 2 * i + 2))
	punkty.add((2 * i, 2 * i + 1))
print(len(punkty))
for i in punkty:
	print(i[0], i[1])


n = int(input())
print(3 * n + 4)
print('0 0', '0 1', sep='\n')
i = 1
j = 0
for k in range(n):
	print(i, j)
	print(i, j + 1)
	print(i, j + 2)
	i += 1
	j += 1
print(i, j)
print(i, j + 1)


t = int(input())
ans = []
ans.append((0, 0))
ans.append((0, 1))
k = 0
l = 1
r = 0
while k < t:
	for j in range(l, l + 3):
		ans.append((l, j - 1))
	k = k + 1
	l = l + 1
ans.append((l, l - 1))
ans.append((l, l))
print(len(ans))
for i in ans:
	print(i[0], i[1])


import sys, math
reader = (line.rstrip() for line in sys.stdin)
input = reader.__next__

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())
import collections as col
import math

def solve():
	N = getInt()
	print(3 * N + 4)
	print(0, 0)
	print(0, 1)
	start = 0
	for x in range(1, N + 1):
		print(x, start)
		print(x, start + 1)
		print(x, start + 2)
		start += 1
	print(N + 1, start)
	print(N + 1, start + 1)
solve()


n = int(input())
k = 7 + (n - 1) * 3
print(k)
l = [(0, 0), (1, 0), (0, 1), (1, 1), (1, 2), (2, 1), (2, 2)]
for (x, y) in l:
	print(x, y)
(x, y) = (2, 2)
for i in range(n - 1):
	print(x + 1, y)
	print(x, y + 1)
	print(x + 1, y + 1)
	x += 1
	y += 1


def solve(k):
	l = [[0, 0], [0, 1], [1, 0]]
	i = 1
	while i <= k:
		l.append([i, i])
		l.append([i + 1, i])
		l.append([i, i + 1])
		i += 1
	l.append([i, i])
	print(len(l))
	for i in l:
		print(i[0], i[1])
k = int(input())
solve(k)


import sys
from collections import defaultdict as dd
from queue import Queue
import math
import itertools
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
input = lambda : sys.stdin.buffer.readline().rstrip()
q = int(input())
a = [[0, 0], [1, 0]]
w = 0
e = 1
for i in range(q):
	for j in range(3):
		a.append([w, e])
		w += 1
	e += 1
	w = e - 1
a.append([w, e])
w += 1
a.append([w, e])
print(len(a))
for i in a:
	print(*i)


def solve(n):
	n += 2
	cells = set()
	for i in range(n):
		cells.add((i, i))
		if i != n - 1:
			cells.add((i + 1, i))
			cells.add((i, i + 1))
	print(len(cells))
	for (c, r) in cells:
		print(c, r)
N = int(input())
solve(N)


import sys, math, itertools, collections, copy
input = sys.stdin.readline
N = int(input())
ans = []
(x, y) = (0, 1)
ans.append([0, 0])
for i in range(N + 1):
	ans.append([x, y])
	(x, y) = (y, x)
	ans.append([x, y])
	ans.append([max(x, y), max(x, y)])
	(x, y) = (x + 1, y + 1)
print(len(ans))
for i in range(len(ans)):
	print(*ans[i])


import sys
input = sys.stdin.readline
t = int(input())
print((t + 1) * 4 - t)
print(0, 0)
print(0, 1)
for i in range(t):
	print(1 + i, i)
	print(1 + i, i + 1)
	print(1 + i, i + 2)
print(i + 2, i + 1)
print(i + 2, i + 2)


n = int(input())
print(3 * n + 4)
for k in range(n + 2):
	print(f'{k} {k}')
t = n + 1
(i, j) = (1, 0)
while t > 0:
	print(f'{i} {j}')
	i += 1
	j += 1
	t -= 1
t = n + 1
(i, j) = (0, 1)
while t > 0:
	print(f'{i} {j}')
	i += 1
	j += 1
	t -= 1


n = int(input())
ans = []
x = 0
y = 3
for i in range(n):
	c = (x + 1, y)
	dx = [1, -1, 0, 0, 0]
	dy = [0, 0, 1, -1, 0]
	for j in range(5):
		ans.append((c[0] + dx[j], c[1] + dy[j]))
	if i == 0:
		ans.append((x, y + 1))
	else:
		ans.append((x, y - 1))
	if i + 1 < n:
		ans.append((x + 3, y))
		ans.append((x + 3, y + 1))
		ans.append((x + 3, y + 2))
		ans.append((x + 4, y + 2))
		ans.append((x + 5, y + 2))
		ans.append((x + 6, y + 2))
	else:
		ans.append((x + 3, y))
		ans.append((x + 3, y - 1))
		ans.append((x + 3, y - 2))
		ans.append((x + 3, y - 3))
		x = x + 3
		while x >= 2:
			x -= 1
			ans.append((x, y - 3))
		ans.append((x, y - 2))
	x += 5
print(len(ans))
for item in ans:
	print(item[0], item[1])


n = int(input())
print(3 * n + 4)
val = 0
pos = 0
print(str(val) + ' 0')
print(str(val) + ' 1')
val += 1
for i in range(n):
	print(str(val) + ' ' + str(pos))
	print(str(val) + ' ' + str(pos + 1))
	print(str(val) + ' ' + str(pos + 2))
	val += 1
	pos += 1
print(str(val) + ' ' + str(pos))
print(str(val) + ' ' + str(pos + 1))


N = int(input())

def add_black(s, x, y):
	s.add((x, y))
	s.add((x + 1, y))
	s.add((x - 1, y))
	s.add((x, y + 1))
	s.add((x, y - 1))
if N == 1:
	print(15)
	print(0, 0)
	print(0, 1)
	print(0, 2)
	print(1, 2)
	print(2, 2)
	print(2, 1)
	print(2, 0)
	print(1, 0)
	print(0, -1)
	print(0, -2)
	print(-1, -2)
	print(-2, -2)
	print(-2, -1)
	print(-2, 0)
	print(-1, 0)
else:
	s = set()
	down = False
	(x, y) = (0, 0)
	for i in range(N):
		add_black(s, x, y)
		if i == N - 1:
			break
		if down:
			y += 1
		else:
			x += 1
		down = not down
	for i in range(y + 3 + 1):
		s.add((-2, i))
	for i in range(-2, x + 1):
		s.add((i, y + 3))
	if N % 2:
		s.add((x, y + 2))
	else:
		s.add((x + 1, y + 3))
		s.add((x + 2, y + 3))
		s.add((x + 2, y + 2))
		s.add((x + 2, y + 1))
		s.add((x + 2, y))
	print(len(s))
	for (x, y) in s:
		print(x, y)


import sys
input = sys.stdin.readline
getS = lambda : input().strip()
getN = lambda : int(input())
getList = lambda : list(map(int, input().split()))
getZList = lambda : [int(x) - 1 for x in input().split()]
INF = 10 ** 20
MOD = 1000000007

def solve():
	n = getN()
	print(4 + 3 * n)
	print(0, 0)
	print(0, 1)
	for i in range(1, n + 1):
		print(i, i - 1)
		print(i, i)
		print(i, i + 1)
	print(n + 1, n)
	print(n + 1, n + 1)

def main():
	n = getN()
	for _ in range(n):
		solve()
solve()


n = int(input())
x = 0
y = 0
ax = []
ay = []
for k in range(n + 1):
	if k == n:
		ax.append(x + 1)
		ay.append(y + 1)
	ax.append(x)
	ay.append(y)
	ax.append(x)
	ay.append(y + 1)
	ax.append(x + 1)
	ay.append(y)
	x += 1
	y += 1
print(len(ax))
for i in range(len(ax)):
	print(str(ax[i]) + ' ' + str(ay[i]))


def solve():
	squares = [[0, 0]]
	for i in range(1, n + 2):
		squares.append([i, i])
		squares.append([i - 1, i])
		squares.append([i, i - 1])
	return squares
n = int(input())
result = solve()
print(3 * (n + 1) + 1)
for i in result:
	print(*i)


m = int(input())
print(3 * m + 4)
print(m + 1, m + 1)
for i in range(m + 1):
	print(i + 1, i)
	print(i, i + 1)
	print(i, i)


def main():
	n = int(input())
	a = set()
	c = 1
	for i in range(n):
		a.add((c - 1, c - 1))
		a.add((c, c))
		a.add((c + 1, c + 1))
		a.add((c - 1, c))
		a.add((c, c - 1))
		a.add((c, c + 1))
		a.add((c + 1, c))
		c += 1
	print(len(a))
	for i in a:
		print(i[0], i[1])
	return
main()


n = int(input())
L1 = []
L2 = []
L = []
s = set()
for i in range(3):
	for j in range(3):
		if (i, j) != (1, 1):
			L.append((i, j))
			s.add((i, j))
for k in range(1, n + 1):
	for i in range(8):
		c = (L[i][0] + 2 * k, L[i][1] + 2 * k)
		if c not in s:
			L.append(c)
			s.add(c)
print(len(L))
for i in L:
	print(i[0], i[1])


n = int(input())
ans = set()
for i in range(n):
	ans.add((i, i))
	ans.add((i, i + 1))
	ans.add((i + 1, i))
i += 1
ans.add((i, i))
ans.add((i, i + 1))
ans.add((i + 1, i))
ans.add((i + 1, i + 1))
print(len(ans))
for (i, j) in ans:
	print(i, j)


n = int(input())
num = 4 + 3 * n
print(num)
print(0, 0)
print(1, 0)
print(0, 1)
print(1, 1)
x = 1
y = 1
for i in range(n):
	print(x + 1, y)
	print(x, y + 1)
	print(x + 1, y + 1)
	x += 1
	y += 1


n = int(input())
print((n + 1) * 3 + 1)
for k in range(n + 1):
	print(k, k)
	print(k + 1, k)
	print(k, k + 1)
print(n + 1, n + 1)


INT_MAX = 10 ** 11 + 7
MOD = 10 ** 9 + 7

def INPUT():
	return list((int(i) for i in input().split()))

def LIST_1D_ARRAY(n):
	return [0 for _ in range(n)]

def LIST_2D_ARRAY(m, n):
	return [[0 for _ in range(n)] for _ in range(m)]
import math
n = int(input())
print(n + 1 + n + 2 + n + 1)
for x in range(n + 1):
	y = n - x
	print(x, y)
for x in range(n + 2):
	y = n + 1 - x
	print(x, y)
for x in range(1, n + 2):
	y = n + 2 - x
	print(x, y)


def solution(n):
	ans = [[0, 0]]
	for i in range(1, n + 2):
		ans.append([i, i])
		ans.append([i - 1, i])
		ans.append([i, i - 1])
	return ans
n = int(input())
ans = solution(n)
print(len(ans))
for i in ans:
	print(*i)


n = int(input())
k = 7 + 3 * (n - 1)
print(k)
print('0 0')
print('-1 0')
print('0 -1')
print('-1 -1')
coordinate = [0, 0]
while n > coordinate[0]:
	print(f'{coordinate[0]} {coordinate[1] + 1}')
	print(f'{coordinate[0] + 1} {coordinate[1] + 1}')
	print(f'{coordinate[0] + 1} {coordinate[1]}')
	coordinate[0] += 1
	coordinate[1] += 1


import sys
n = int(sys.stdin.readline())
print(7 * n + 8)
x_arr = []
y_arr = []
x = 0
y = 0
for i in range(n):
	print(x, y)
	print(x + 1, y)
	print(x, y + 1)
	x_arr.append(x)
	x_arr.append(x + 1)
	x_arr.append(x)
	y_arr.append(y)
	y_arr.append(y)
	y_arr.append(y + 1)
	x += 1
	y += 1
print(-1, 0)
print(0, -1)
x_arr.append(-1)
y_arr.append(0)
x_arr.append(0)
y_arr.append(-1)
wx = -2
wy = 0
for g in range(n + 2):
	print(wx, wy)
	x_arr.append(wx)
	y_arr.append(wy)
	wy += 1
wx += 1
wy -= 1
for h in range(n + 1):
	print(wx, wy)
	x_arr.append(wx)
	y_arr.append(wy)
	wx += 1
sx = 0
sy = -2
for a in range(n + 2):
	print(sx, sy)
	x_arr.append(sx)
	y_arr.append(sy)
	sx += 1
sx -= 1
sy += 1
for b in range(n + 1):
	print(sx, sy)
	x_arr.append(sx)
	y_arr.append(sy)
	sy += 1


from sys import stdin, gettrace
if gettrace():
	inputi = input
else:

	def input():
		return next(stdin)[:-1]

	def inputi():
		return stdin.buffer.readline()

def main():
	n = int(input())
	ln = 3 + 2 * n
	res = []
	for i in range(n // 2 + 1):
		res += [(0, i * 4), (0, i * 4 + 1), (0, i * 4 + 2), (1, i * 4), (1, i * 4 + 2)]
	for i in range(ln):
		res += [(2, i)]
	for i in range((n + 1) // 2):
		res += [(3, i * 4 + 2), (3, i * 4 + 4), (4, i * 4 + 2), (4, i * 4 + 3), (4, i * 4 + 4)]
	print(len(res))
	for r in res:
		print(r[0], r[1])
main()


n = int(input())
l = [(0, 0), (1, 0), (0, 1), (1, 1), (2, 1), (1, 2), (2, 2)]
x = 2
y = 2
for i in range(1, n):
	l += [(x + 1, y), (x, y + 1), (x + 1, y + 1)]
	x += 1
	y += 1
print(len(l))
for i in l:
	print(i[0], i[1])


import pprint

def add_up(lis, j, k):
	lis.append(tuple([j, 2 + k]))

def add_down(lis, j, k):
	lis.append(tuple([j, -2 + k]))
n = int(input())
points = n * 9
sol = []
cnt = 0
k = 0
for i in range(3, 5 * n, 5):
	lis = []
	for j in range(i - 2, i + 3):
		lis.append(tuple([j, k]))
		cnt += 1
		if j == i - 2 or j == i - 1:
			add_up(lis, j, k)
			cnt += 1
		elif j == i:
			cnt += 4
			add_up(lis, j, k)
			add_down(lis, j, k)
			lis.append(tuple([j, 1 + k]))
			lis.append(tuple([j, -1 + k]))
		elif j == i + 2 or j == i + 1:
			add_down(lis, j, k)
			cnt += 1
	sol.append(lis)
	k -= 2
sol[0].append((1, 1))
sol[n - 1].append((5 * n, -1 + k + 2))
cnt += 2
print(cnt)
for i in range(len(sol)):
	for j in range(len(sol[i])):
		print(sol[i][j][0], sol[i][j][1])


n = int(input())
l = [(0, 0), (1, 0), (0, 1), (1, 1), (1, 2), (2, 1), (2, 2)]
s = set(l)
n -= 1
mid = (2, 2)
while n > 0:
	(x, y) = mid
	s.add((x, y + 1))
	s.add((x + 1, y))
	s.add((x + 1, y + 1))
	mid = (x + 1, y + 1)
	n -= 1
print(len(s))
for i in s:
	print(i[0], i[1])


n = int(input())
print(n * 7 + 8)
print(2, 0)
print(3, 0)
print(4, 0)
print(2, 1)
print(4, 1)
print(2, 2)
print(3, 2)
print(4, 2)
flag = 1
temp = 0
for i in range(n):
	a = 2 * i + 2
	b = 2 * i + 3
	c = 2 * i + 4
	if flag:
		print(1, a)
		print(0, a)
		print(2, b)
		print(0, b)
		print(0, c)
		print(1, c)
		print(2, c)
		flag = 0
	else:
		print(3, a)
		print(4, a)
		print(2, b)
		print(4, b)
		print(3, c)
		print(4, c)
		print(2, c)
		flag = 1


for _ in range(1):
	n = int(input())
	sol = []
	for i in range(3 * n + 4):
		sol.append((i, 0))
		sol.append((i, 5))
	for i in range(1, 5):
		sol.append((0, i))
		sol.append((3 * n + 4 - 1, i))
	ind = 2
	while n > 1:
		sol.append((ind, 1))
		sol.append((ind, -1))
		sol.append((ind + 1, 1))
		sol.append((ind + 1, -1))
		ind += 3
		n -= 2
	if n == 1:
		sol.append((-1, 0))
		sol.append((0, -1))
		sol.append((-1, -1))
	print(len(sol))
	for (x, y) in sol:
		print(x, y)


np1 = int(input()) + 1
print(np1 * 3 + 1)
for i in range(np1):
	print(i, i)
	print(i, i + 1)
	print(i + 1, i)
print(np1, np1)


def solution(n):
	A = []
	for i in range(n):
		A.append((2 * i, 2 * i))
	for i in range(n - 1):
		A.append((2 * i, 2 * i + 1))
		A.append((2 * i + 1, 2 * i))
		A.append((2 * i, 2 * i + 2))
		A.append((2 * i + 2, 2 * i))
		A.append((2 * i + 1, 2 * i + 2))
		A.append((2 * i + 2, 2 * i + 1))
	return A
n = int(input())
A = solution(n + 2)
print(len(A))
for (i, j) in A:
	print(i, j)


import sys
import itertools
sys.setrecursionlimit(10 ** 7)
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(input())
ANS = [(0, 0), (1, 0), (0, 1), (1, 1), (2, 1), (1, 2), (2, 2)]
for i in range(N - 1):
	ANS += [(i + 3, i + 3), (i + 2, i + 3), (i + 3, i + 2)]
print(len(ANS))
for (x, y) in ANS:
	print(x, y)


a = int(input())
n = a * 3 + 4
n1 = a + 2
print(n)
for i in range(n1):
	if i == 0:
		print(a, 0)
		print(a + 1, 0)
	elif i <= a:
		print(a - i, i)
		print(a - i + 1, i)
		print(a - i + 2, i)
	else:
		print(0, a + 1)
		print(1, a + 1)


n = int(input())
print(1 + 7 * (n + 1))
print(0, 0)
cx = cy = 0
for _ in range(n + 1):
	print(cx + 1, cy)
	print(cx + 2, cy)
	print(cx + 2, cy - 1)
	print(cx + 2, cy - 2)
	print(cx + 1, cy - 2)
	print(cx, cy - 2)
	print(cx, cy - 1)
	cx += 2
	cy -= 2


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


from sys import stdin, stdout
import heapq
import cProfile
from collections import Counter, defaultdict, deque
from functools import reduce
import math

def get_int():
	return int(stdin.readline().strip())

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

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

def solve():
	n = get_int()
	(i, j) = (0, 0)
	print((n + 1) * 3 + 1)
	print(i, j)
	while n > -1:
		print(i, j + 1)
		print(i + 1, j)
		print(i + 1, j + 1)
		i += 1
		j += 1
		n -= 1

def main():
	solve()
TestCases = False
if TestCases:
	for i in range(get_int()):
		main()
else:
	main()


n = int(input())
if n == 1:
	print(7)
	print('0 0')
	print('1 0')
	print('0 1')
	print('1 1')
	print('2 1')
	print('1 2')
	print('2 2')
elif n % 2 == 0:
	k = 4 * n + 2 * int(n / 2) - 2 + 12
	print(k)
	for j in range(n + int(n / 2) - 1 + 4):
		print(str(j) + ' 1')
		print(str(j) + ' 4')
	o = 0
	for j in range(2, n + int(n / 2) - 1 + 2):
		if o < 2:
			print(str(j) + ' 0')
			print(str(j) + ' 2')
			o += 1
		else:
			o = 0
	print('0 2')
	print('0 3')
	print(str(n + int(n / 2) - 1 + 3) + ' 2')
	print(str(n + int(n / 2) - 1 + 3) + ' 3')
else:
	k = 4 * n + 2 * int((n + 1) / 2) - 2 + 9
	print(k)
	for j in range(n + int((n + 1) / 2) - 1 + 2):
		print(str(j) + ' 1')
		print(str(j) + ' 4')
	o = 0
	kk = 0
	for j in range(2, n + int((n + 1) / 2) - 1 + 2):
		if o < 2:
			print(str(j) + ' 0')
			print(str(j) + ' 2')
			o += 1
		else:
			o = 0
	print('0 2')
	print('0 3')
	print(str(n + int((n + 1) / 2) - 1 + 1) + ' 3')
	print(str(n + int((n + 1) / 2) - 1 + 2) + ' 0')
	print(str(n + int((n + 1) / 2) - 1 + 2) + ' 1')


n = int(input())
k = 0
(x0, y0) = (0, 0)
(x1, y1) = (1, 0)
(x2, y2) = (0, 1)
(x3, y3) = (1, 1)
ans = [(0, 0)]
for _ in range(n + 1):
	ans.append((x1, y1))
	ans.append((x2, y2))
	ans.append((x3, y3))
	x1 += 1
	y1 += 1
	x2 += 1
	y2 += 1
	x3 += 1
	y3 += 1
print(len(ans))
for res in ans:
	print(*res)


import sys
inputr = lambda : sys.stdin.readline().rstrip('\n')
input = sys.stdin.readline
n = int(input())
print(4 + 3 * n)
print(0, 0)
print(1, 0)
print(0, 1)
print(1, 1)
(x, y) = (1, 1)
for _ in range(n):
	print(x + 1, y)
	print(x + 1, y + 1)
	print(x, y + 1)
	x += 1
	y += 1


def solve():
	n = int(input())
	i = 1
	print(n * 3 + 4)
	print('0 0')
	print('0 1')
	j = 0
	c = 1
	while c <= n:
		for x in range(j, j + 3):
			print(i, x)
		i += 1
		j += 1
		c += 1
	print(i, j)
	print(i, j + 1)
solve()


from functools import reduce
n = int(input())
x = [[0, 0]]
for i in range(n + 1):
	x.append([i, i + 1])
	x.append([i + 1, i])
	x.append([i + 1, i + 1])
print(len(x))
for i in x:
	print(i[0], i[1])


import sys
import os
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')
mod = 10 ** 9 + 7

def lcm(x, y):
	return x * y / gcd(x, y)

def fact(x, mod=mod):
	ans = 1
	for i in range(1, x + 1):
		ans = ans * i % mod
	return ans

def arr2D(n, m, default=0):
	lst = []
	for i in range(n):
		temp = [default] * m
		lst.append(temp)
	return lst

def sortDictV(x):
	return {k: v for (k, v) in sorted(x.items(), key=lambda item: item[1])}

def solve(n):
	grayCell = set()
	for i in range(n):
		grayCell.add((i, i))
		grayCell.add((i, i + 1))
		grayCell.add((i, i - 1))
		grayCell.add((i + 1, i))
		grayCell.add((i - 1, i))
	grayCell.add((-1, -1))
	grayCell.add((n, n))
	print(n * 3 + 4)
	for i in grayCell:
		print(i[0], i[1])
n = int(input())
solve(n)


n = int(input())
points = set()

def add_square(x, y):
	for a in range(x, x + 3):
		for b in range(y, y + 3):
			if a == x + 1 and b == y + 1:
				continue
			points.add((a, b))
(x, y) = (0, 0)
for i in range(n + 1):
	add_square(x, y)
	x += 2
	y += 2
print(len(points))
for point in points:
	print(*point)


from collections import *
from math import *
n = int(input())
ct = 0
i = 1
ans = [[0, 0]]
while ct <= n:
	ans.append([i, i])
	ans.append([i - 1, i])
	ans.append([i, i - 1])
	i += 1
	ct += 1
print(len(ans))
for i in ans:
	print(*i)


k = int(input())
x = [[0, 1], [0, 2], [1, 0], [1, 2], [2, 0], [2, 1], [2, 2]]
print(8 + 7 * k)
print(0, 0)

def prr():
	global x
	for i in x:
		print(*i)
prr()
for i in range(k):
	for j in range(7):
		x[j][0] += 2
		x[j][1] += 2
	prr()


import sys
import math
import heapq
from collections import defaultdict, deque
input = sys.stdin.readline

def r():
	return int(input())

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

def rl():
	return list(map(int, input().split()))
n = r()
a0 = 1
cnt = 0
res = [[0, 0], [0, 1], [1, 0]]
res.append([a0, a0])
while cnt < n:
	res.append([a0 + 1, a0])
	res.append([a0, a0 + 1])
	res.append([a0 + 1, a0 + 1])
	cnt += 1
	a0 += 1
print(len(res))
for i in res:
	print(i[0], i[1])


import sys
inpy = [int(x) for x in sys.stdin.read().split()]
n = inpy[0]
print(3 * n + 4)
(x, y) = (0, 0)
for i in range(n + 1):
	print(x, y)
	print(x + 1, y)
	print(x, y + 1)
	(x, y) = (x + 1, y + 1)
print(x, y)


n = int(input())
main = [(1, 1), (0, 2), (1, 2), (2, 2), (0, 3), (1, 3), (2, 3), (1, 4)]
if n % 2 == 0:
	print(6 * n + 10)
	for i in range(n // 2):
		for x in main:
			print(x[0], x[1] + 4 * i)
	for j in range(0, 2 + 2 * n):
		print(5, j)
	for j in range(1, 5):
		print(j, 0)
	for j in range(1, 5):
		print(j, 1 + 2 * n)
elif n > 1:
	k = n // 2
	print(7 + 10 + 12 * k)
	for i in range(k):
		for x in main:
			print(x[0], x[1] + 4 * i)
	for j in range(1, 5):
		print(j, 0)
	for j in range(1, 5):
		print(j, 1 + 4 * k)
	print(-1, 4 * k + 1)
	print(0, 4 * k + 1)
	print(-1, 4 * k + 2)
	print(1, 4 * k + 2)
	for i in range(-1, 2):
		print(i, 4 * k + 3)
	for j in range(0, 2 + 4 * k):
		print(5, j)
else:
	print(7)
	print(1, 1)
	print(2, 1)
	for i in range(0, 3):
		print(i, 2)
	print(0, 3)
	print(1, 3)


n = int(input())
k = 8 + 7 * n
print(k)
print(0, 0)
for i in range(n + 1):
	x = 2 * i
	print(x + 1, x)
	print(x + 2, x)
	print(x + 2, x + 1)
	print(x + 2, x + 2)
	print(x + 1, x + 2)
	print(x, x + 2)
	print(x, x + 1)


import sys
from fractions import gcd
from math import ceil, sqrt, sin, pi, tan
from collections import defaultdict
read = sys.stdin.buffer.readline
import heapq
mi = lambda : map(int, read().split())
li = lambda : list(mi())
cin = lambda : int(read())
for _t in range(1):
	k = cin()
	n = 2 * k + 1
	mat = [[0 for i in range(2 * k + 1)] for j in range(5)]
	mat[2][0] = 1
	mat[3][0] = 1
	mat[3][1] = 1
	mat[2][1] = 1
	mat[1][1] = 1
	mat[1][2] = 1
	mat[2][2] = 1
	(r, c) = (2, 2)
	k -= 1
	while k > 0:
		k -= 1
		if mat[r - 1][c]:
			mat[r - 1][c] = 0
			mat[r][c + 1] = 1
			mat[r][c + 2] = 1
			mat[r + 1][c + 1] = 1
			mat[r - 1][c + 1] = 1
			mat[r + 1][c + 2] = 1
			mat[r - 2][c - 1] = 1
			mat[r - 2][c] = 1
			mat[r - 2][c + 1] = 1
			c += 2
		else:
			mat[r + 1][c] = 0
			mat[r][c + 1] = 1
			mat[r][c + 2] = 1
			mat[r + 1][c + 1] = 1
			mat[r - 1][c + 1] = 1
			mat[r - 1][c + 2] = 1
			mat[r + 2][c - 1] = 1
			mat[r + 2][c] = 1
			mat[r + 2][c + 1] = 1
			c += 2
	ans = []
	for i in range(5):
		for j in range(n):
			if mat[i][j]:
				ans.append([i, j])
	print(len(ans))
	for el in ans:
		print(el[0], el[1])


from sys import stdout
n = int(input())
cnt = 0
fullans = ''
comp = n + 1
for i in range(comp):
	ans1 = f'{i} {i}\n'
	ans2 = f'{i + 1} {i}\n'
	ans3 = f'{i} {i + 1}\n'
	fullans += ans1 + ans2 + ans3
	cnt += 3
end = f'{comp} {comp}'
fullans += end
cnt += 1
stdout.write(str(cnt) + '\n')
stdout.write(fullans)


import math
n = int(input())
ans = []
ans.append([0, 0])
ans.append([1, 0])
for i in range(n):
	for j in range(3):
		ans.append([i + j, i + 1])
ans.append([n, n + 1])
ans.append([n + 1, n + 1])
print(len(ans))
for (i, j) in ans:
	print(i, ' ', j)


def modinv(n, p):
	return pow(n, p - 2, p)

def main():
	n = int(input())
	a = 7
	x = a + (n - 1) * 3
	print(x)
	print(0, 0)
	for i in range(1, n + 2):
		(x, y) = (i, i)
		print(x - 1, y)
		print(x, y)
		print(x, y - 1)
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			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')
main()


import sys

def draw_square(center):
	(x, y) = center
	coords = [(x + 1, y), (x + 2, y), (x, y + 1), (x + 2, y + 1), (x, y + 2), (x + 1, y + 2), (x + 2, y + 2)]
	for (x_, y_) in coords:
		print(x_, y_)
	return (x + 2, y + 2)

def solve():
	gray_cells = int(input())
	print(8 + 7 * gray_cells)
	print(0, 0)
	center = draw_square((0, 0))
	for _ in range(gray_cells):
		center = draw_square(center)
solve()
sys.exit(0)


from sys import stdin
from collections import deque
mod = 10 ** 9 + 7
import sys
import random
from queue import PriorityQueue
from collections import Counter as cc
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
from itertools import permutations
from math import factorial as f

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p
import sys
n = int(input())
x = 10 ** 9
y = 0
print(4 * (n + 1) - n)
for i in range(n + 1):
	print(x, y)
	print(x - 1, y)
	print(x, y + 1)
	x -= 1
	y += 1
print(x, y)


class Node:

	def __init__(self, x, y):
		self.x = x
		self.y = y
k = int(input())
l = []
for i in range(1, k + 2):
	l.append(Node(i, i))
li = []
for i in l:
	li.append([i.x, i.y])
	li.append([i.x - 1, i.y])
	li.append([i.x, i.y - 1])
li.append([0, 0])
print(len(li))
for (i, j) in li:
	print(i, j)


m = int(input())
print(3 * m + 4)
for i in range(m + 2):
	if i > 0:
		print(i, i)
	print(i + 1, i)
	if i < m + 1:
		print(i + 2, i)


from sys import stdin
from collections import defaultdict as dd
from collections import deque as dq
import itertools as it
n = int(input())
coords = []
print(7 + 3 * (n - 1))
coords = [(0, 0), (1, 0), (0, 1), (2, 1), (1, 2), (1, 1), (2, 2)]
for tup in coords:
	print(*tup)
for i in range(2, n + 1):
	print(i, i + 1)
	print(i + 1, i)
	print(i + 1, i + 1)


def main():
	n = int(input())
	pos = [(0, 0), (0, 1), (n + 1, n), (n + 1, n + 1)]
	for i in range(1, n + 1):
		pos.append((i, i - 1))
		pos.append((i, i))
		pos.append((i, i + 1))
	print(len(pos))
	for i in pos:
		print(i[0], i[1])
t = 1
for i in range(t):
	main()


n = int(input()) + 1

def print_coord(x, y):
	print(str(x) + ' ' + str(y))

def print_trio(x, y):
	print_coord(x, y)
	print_coord(x + 1, y)
	print_coord(x, y + 1)
print(n * 3 + 1)
for o in range(n):
	print_trio(o, o)
print_coord(n, n)


import sys
input = sys.stdin.readline

def solve():
	n = int(input())
	print(3 * (n + 1) + 1)

	def draw(x, y):
		for i in range(2):
			for j in range(2):
				if not i == j == 1:
					sys.stdout.write(str(x + i) + ' ' + str(y + j) + '\n')
	for i in range(0, n + 1):
		draw(i, i)
	print(n + 1, n + 1)
tt = 1
for test in range(tt):
	solve()


import math

def check(n):
	ans = 0
	while n:
		a = int(math.log2(n))
		ans += 2 ** (a + 1) - 1
		n -= 2 ** a
	return ans

def ch(arr, brr, step):
	if step > 1:
		return -1
	for i in range(3):
		if brr[i] < arr[i]:
			return -1
	if brr[0] - arr[0] == brr[1] - arr[1] == brr[2] - arr[2] or (brr[0] / arr[0] == brr[1] / arr[1] == brr[2] / arr[2] and brr[0] % arr[0] == 0):
		return 1
	diff = 0
	for i in range(3):
		diff = diff ^ brr[i] - arr[i]
	if diff == 0:
		return 1
	if step > 0:
		return -1
	li = [0, 0, 0]
	for i in range(3):
		li[i] = brr[k] // arr[k]
		div = -1
		for j in range(3):
			if li[j] == 0 or li[j] == 1:
				continue
			if div == -1:
				div = li[j]
			else:
				div = min(div, li[j])
			hh = arr
			jj = brr
			for k in range(i, j + 1):
				hh[k] = div * hh[k]
			if ch(hh, jj, step + 1) == 1:
				return 2
	for i in range(2):
		for j in range(i + 1, 3):
			div = 10 ** 9 + 6
			for k in range(i, j + 1):
				div = min(div, brr[k] // arr[k])
			if div == 0:
				continue
			hh = arr
			jj = brr
			for k in range(i, j + 1):
				hh[k] = div * hh[k]
			if ch(hh, jj, step + 1) == 1:
				return 2

def res(arr):
	diff = 0
	for i in range(3):
		diff = diff ^ arr[i]
	if diff == 0:
		return 1
	for i in range(2):
		if brr[i] % arr[i] != 0:
			continue
		div = brr[i] // arr[i]
		count = 0
		for j in range(i + 1, 3):
			if brr[j] % arr[j] != 0:
				continue
			if div == brr[j] // arr[j]:
				count += 1
		if count > 1:
			return 2

def solution():
	n = int(input())
	k = 4 + n * 3
	print(k)
	for i in range(0, 2):
		for j in range(0, 2):
			print(f'{i} {j}')
	ll = [[1, 2], [2, 1], [2, 2]]
	for j in range(1, n + 1):
		for i in ll:
			print(f'{i[0]} {i[1]}')
			i[0] += 1
			i[1] += 1
solution()


t = 1
for test in range(1, t + 1):
	n = int(input())
	print(n + n * 2 + 4)
	print(0, 0)
	print(-1, 0)
	print(0, 1)
	print(-1, 1)
	for i in range(1, n):
		print(0 + i, 0 - i)
		print(i - 1, -i)
		print(i, -i + 1)
	print(n - 1, -(n - 1) - 1)
	print(n, -(n - 1))
	print(n, -(n - 1) - 1)


n = int(input())
coords = []
for i in range(n + 1):
	coords.append((i, i))
	coords.append((i + 1, i))
	coords.append((i, i + 1))
coords.append((n + 1, n + 1))
print(len(coords))
for i in coords:
	print(*i)


n = int(input())
x = 0
y = 0
f = 0
print(8 * (n + 1) - n)
print(x, y)
for i in range(n + 1):
	if f == 0:
		print(x + 1, y)
		print(x + 2, y)
		print(x, y + 1)
		print(x + 2, y + 1)
		print(x, y + 2)
		print(x + 1, y + 2)
		print(x + 2, y + 2)
		x += 2
		f = 1
	else:
		print(x + 1, y)
		print(x + 2, y)
		print(x, y - 1)
		print(x + 2, y - 1)
		print(x, y - 2)
		print(x + 1, y - 2)
		print(x + 2, y - 2)
		x += 2
		f = 0


n = int(input())
print(n * 3 + 4)
print(0, 0)
print(0, 1)
yo = 0
xo = 1
for i in range(n):
	for ii in range(3):
		print(xo, ii + yo)
	yo += 1
	xo += 1
for ii in range(2):
	print(xo, ii + yo)


n = int(input())
arr = [['#' for i in range(600)] for j in range(600)]
arr[0][0] = 'G'
for i in range(n + 1):
	arr[i][i + 1] = 'G'
	arr[i + 1][i] = 'G'
	arr[i + 1][i + 1] = 'G'
ans = 0
for i in arr:
	ans += i.count('G')
print(ans)
for i in range(600):
	for j in range(600):
		if arr[i][j] == 'G':
			print(j, i)


n = int(input())
print(15 + (n - 1) * 7)
if n % 2 == 0:
	k = (n + 2) // 2
else:
	k = (n + 1) // 2
f = 0
for i in range(k):
	print(f, 0)
	f += 1
	print(f, 0)
	f += 1
	print(f, 0)
	f += 2
f = 0
for i in range(k):
	print(f, 1)
	f += 2
	print(f, 1)
	f += 2
k = 5 + (n - 1) * 2
for i in range(k):
	print(i, 2)
if n % 2 == 0:
	k = n // 2
else:
	k = (n + 1) // 2
f = 2
for i in range(k):
	print(f, 3)
	f += 2
	print(f, 3)
	f += 2
f = 2
for i in range(k):
	print(f, 4)
	f += 1
	print(f, 4)
	f += 1
	print(f, 4)
	f += 2


import math

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

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

def bs(arr, l, r, x):
	while l <= r:
		mid = l + (r - l) // 2
		if arr[mid] == x:
			return arr[mid]
		elif arr[mid] < x:
			l = mid + 1
		else:
			r = mid - 1
	return -1

def swap(list, pos1, pos2):
	(list[pos1], list[pos2]) = (list[pos2], list[pos1])
	return list
n = int(input())
x = []
x.append((1, 1))
x.append((0, 1))
x.append((1, 0))
x.append((1, 2))
x.append((2, 1))
x.append((0, 0))
x.append((2, 2))
for i in range(n - 1):
	x.append((i + 2, i + 3))
	x.append((i + 3, i + 2))
	x.append((i + 3, i + 3))
print(len(x))
for i in range(len(x)):
	print(x[i][0], x[i][1])


x = int(input())
res = []
res.append([0, 0])
res.append([1, 0])
res.append([0, 1])
res.append([1, 1])
cur = 3
for n in range(x):
	a = res[cur][0]
	b = res[cur][1]
	res.append([a + 1, b])
	res.append([a, b + 1])
	res.append([a + 1, b + 1])
	cur += 3
print(len(res))
for n in res:
	print(*n)


n = int(input())
print(8 + 7 * n)
if n % 2 == 0:
	n = 2 * n + 3
	for i in range(n):
		print(i, 0)
	for i in range(0, n, 2):
		print(i, 1)
		if i != 0 and i != n - 1:
			print(i, -1)
	for i in range(0, n, 4):
		print(i, 2)
		print(i + 1, 2)
		print(i + 2, 2)
	for i in range(2, n - 1, 4):
		print(i, -2)
		print(i + 1, -2)
		print(i + 2, -2)
else:
	n = 2 * n + 3
	for i in range(n):
		print(i, 0)
	for i in range(0, n, 2):
		if i != n - 1:
			print(i, 1)
		if i != 0:
			print(i, -1)
	for i in range(0, n - 1, 4):
		print(i, 2)
		print(i + 1, 2)
		print(i + 2, 2)
	for i in range(2, n - 1, 4):
		print(i, -2)
		print(i + 1, -2)
		print(i + 2, -2)


t = 1
while t != 0:
	t -= 1
	n = int(input())
	aux = []
	for p in range(n):
		aux.append([p, p])
		aux.append([p, p + 1])
		aux.append([p + 1, p])
		aux.append([p + 1, p + 1])
		aux.append([p + 1, p + 2])
		aux.append([p + 2, p + 1])
		aux.append([p + 2, p + 2])
	aux = set((tuple(i) for i in aux))
	print(len(aux))
	aux = list(aux)
	for i in range(len(aux)):
		print(*aux[i])


import sys

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

def input_split():
	return [int(i) for i in input().split()]
n = int(input())
base = [(2, 0), (3, 0), (4, 0), (4, 1), (4, 2), (3, 2), (2, 2), (2, 1)]
base2 = [(i - 2, j + 2) for (i, j) in base]
s = set()
upper = n + 1 - (n + 1) // 2
lower = (n + 1) // 2
for i in range(upper):
	shift = 4 * i
	for (x, y) in base:
		s.add((x, y + shift))
for i in range(lower):
	shift = 4 * i
	for (x, y) in base2:
		s.add((x, y + shift))
answer = ['{} {}'.format(i, j) for (i, j) in s]
print(len(answer))
print(*answer, sep='\n')


import sys
input = sys.stdin.readline
RI = lambda : [int(x) for x in sys.stdin.readline().strip().split()]
rw = lambda : input().strip().split()
from collections import defaultdict as df
n = int(input().strip())
l = []
l.append([1, 3])
last = [1, 3]
n += 1
for k in range(n):
	if k % 2 == 0:
		(r, c) = last
		l.append([r, c - 1])
		l.append([r, c - 2])
		l.append([r + 1, c])
		l.append([r + 1, c - 2])
		l.append([r + 2, c])
		l.append([r + 2, c - 1])
		l.append([r + 2, c - 2])
		last = [r + 2, c]
	else:
		(r, c) = last
		l.append([r + 1, c])
		l.append([r + 2, c])
		l.append([r, c + 1])
		l.append([r, c + 2])
		l.append([r + 1, c + 2])
		l.append([r + 2, c + 1])
		l.append([r + 2, c + 2])
		last = [r + 2, c]
	k -= 1
print(len(l))
for i in l:
	print(*i)


n = int(input())
print(n + n + n + 4)
for i in range(n + 2):
	print(i, i)
for i in range(n + 1):
	print(i, i + 1)
for i in range(n + 1):
	print(i + 1, i)


import sys
input = sys.stdin.readline
n = int(input())
ans = []
used = set()
for i in range(n):
	ans.append((i, i))
diff = [(1, 0), (0, 1), (-1, 0), (0, -1)]
ref = ans[:]
for (x, y) in ref:
	for (dx, dy) in diff:
		if (x + dx, y + dy) not in used:
			ans.append((x + dx, y + dy))
			used.add((x + dx, y + dy))
ans.append((-1, -1))
ans.append((n, n))
print(len(ans))
for (x, y) in ans:
	print(x, y)


n = int(input().strip())
x = 0
y = 0
q = []
n += 1
q.append((0, 0))
while n > 0:
	q.append((x + 1, y))
	q.append((x, y + 1))
	q.append((x + 1, y + 1))
	x += 1
	y += 1
	n -= 1
print(len(q))
for (x, y) in q:
	print(x, y)


n = int(input())
lst = [(0, 0), (0, 1), (1, 1), (1, 0)]
(i, j) = (1, 1)
for k in range(n):
	lst.append((i + 1, j))
	lst.append((i, j + 1))
	lst.append((i + 1, j + 1))
	i += 1
	j += 1
print(len(lst))
for k in lst:
	print(k[0], k[1])


import sys
input = sys.stdin.readline

def get_matrix(nodes):
	matrix = [[0] * 25 for _ in range(25)]
	for (x, y) in nodes:
		matrix[y][x] = 1
	return matrix

def solve(n):
	nodes = [(4, 5)]
	(x, y) = (5, 5)
	for _ in range(n):
		nodes.append((x, y))
		nodes.append((x, y + 1))
		nodes.append((x, y - 1))
		nodes.append((x + 1, y))
		x += 2
	if n == 1:
		nodes.append((4, 4))
		nodes.append((6, 6))
	elif n == 2:
		nodes.append((3, 5))
		nodes.append((3, 4))
		nodes.append((3, 3))
		nodes.append((4, 3))
		nodes.append((5, 3))
		nodes.append((7, 3))
		nodes.append((8, 3))
		nodes.append((9, 3))
		nodes.append((9, 4))
		nodes.append((9, 5))
		nodes.append((5, 7))
		nodes.append((6, 7))
		nodes.append((7, 7))
	elif n % 2 == 0:
		nodes.append((4, 4))
		nodes.append((5 + 2 * n - 1, 4))
		(x, y) = (7, 4)
		for _ in range((n - 2) // 2):
			nodes.append((x, y - 1))
			nodes.append((x + 1, y - 1))
			nodes.append((x + 2, y - 1))
			x += 4
		(x, y) = (5, 6)
		for _ in range((n - 2) // 2 + 1):
			nodes.append((x, y + 1))
			nodes.append((x + 1, y + 1))
			nodes.append((x + 2, y + 1))
			x += 4
	elif n % 2 == 1:
		nodes.append((4, 4))
		nodes.append((5 + 2 * n - 1, 6))
		(x, y) = (7, 4)
		for _ in range((n - 2) // 2 + 1):
			nodes.append((x, y - 1))
			nodes.append((x + 1, y - 1))
			nodes.append((x + 2, y - 1))
			x += 4
		(x, y) = (5, 6)
		for _ in range((n - 2) // 2 + 1):
			nodes.append((x, y + 1))
			nodes.append((x + 1, y + 1))
			nodes.append((x + 2, y + 1))
			x += 4
	return nodes
n = int(input())
res = set(solve(n))
print(len(res))
for (a, b) in res:
	print(a, b)


n = int(input())
k = 2 + n * 3 + 2
ans = []
ans.append((0, 0))
ans.append((1, 0))
for i in range(1, n + 1):
	ans.append((i - 1, i))
	ans.append((i, i))
	ans.append((i + 1, i))
ans.append((n, n + 1))
ans.append((n + 1, n + 1))
print(k)
for a in ans:
	print(*a)


n = int(input())
c = 0
print(3 * (n + 1) + 1)
for i in range(n + 1):
	print(i, c)
	print(i, c + 1)
	print(i + 1, c)
	c += 1
print(i + 1, c)


import io
import os
from collections import Counter, defaultdict, deque

def solve(N):
	ans = set([(0, 0)])
	for i in range(N + 1):
		ans.add((i, i + 1))
		ans.add((i + 1, i))
		ans.add((i + 1, i + 1))
	return str(len(ans)) + '\n' + '\n'.join((str(x) + ' ' + str(y) for (x, y) in ans))
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
(N,) = [int(x) for x in input().split()]
ans = solve(N)
print(ans)


a = int(input())
print(1 + 3 * (a + 1))
print(0, 0)
for i in range(1, a + 2):
	print(i, i)
	print(i, i - 1)
	print(i - 1, i)


n = int(input())

def put(a, b):
	if a >= 0 and b >= 0:
		print(a, b)

def printer(i):
	put(i + 1, i)
	put(i + 1, i + 1)
	put(i, i + 1)
i = -1
print(4 + 3 * n)
while i <= n:
	printer(i)
	i += 1


n = int(input())
location = {(0, 0)}
cnt = 0
i = 1
j = 1
while n != cnt:
	if (i, j) not in location:
		location.add((i, j))
		cnt += 1
	i += 1
	if (i, j) not in location:
		location.add((i, j))
	i -= 1
	j += 1
	if (i, j) not in location:
		location.add((i, j))
	i -= 1
	j -= 1
	if (i, j) not in location:
		location.add((i, j))
	i += 1
	j -= 1
	if (i, j) not in location:
		location.add((i, j))
	i += 1
	j += 2
location.add((i, j))
print(len(location))
for elem in location:
	print(*elem)


n = int(input())
print(3 * n + 4)
for i in range(n + 2):
	if i == 0:
		(l, r) = (1, 3)
	elif i == n + 1:
		(l, r) = (0, 2)
	else:
		(l, r) = (0, 3)
	for j in range(l, r):
		print(i, i + j)


import sys
import math

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

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

def get_string():
	return sys.stdin.readline().strip()
n = int(input())
tn = 4 * (n + 1) - n
print(tn)
print(0, 0)
print(0, 1)
y = 1
x = 1
for i in range(n):
	print(x, y - 1)
	print(x, y)
	print(x, y + 1)
	x += 1
	y += 1
print(x, y)
print(x, y - 1)


k = int(input())
r = int(k ** 0.5)
ls = []
ans = 4 + 3 * k
print(ans)
print(*[0, 0])
print(*[0, 1])
print(*[1, 0])
print(*[1, 1])
for i in range(k):
	print(2 + i, 1 + i)
	print(1 + i, 2 + i)
	print(2 + i, 2 + i)


import sys

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

def ri():
	return int(sys.stdin.readline())

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

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')

def print_sq(si, sj, skip_first=False):
	if not skip_first:
		wia([si, sj])
	wia([si, sj + 1])
	wia([si, sj + 2])
	wia([si + 1, sj + 2])
	wia([si + 2, sj + 2])
	wia([si + 2, sj + 1])
	wia([si + 2, sj])
	wia([si + 1, sj])

def solve(n):
	k = 8 * (n + 1) - n
	wi(k)
	for i in range(n + 1):
		print_sq(2 * i, 2 * i, i > 0)

def main():
	n = ri()
	solve(n)
main()


import sys

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

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

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

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 19
MOD = 10 ** 9 + 7
N = INT()
grid = list2d(N + 2, N + 2, 0)
directions = ((1, 0), (-1, 0), (0, 1), (0, -1))
for i in range(1, N + 1):
	grid[i][i] = 1
	for (di, dj) in directions:
		ii = i + di
		ij = i + dj
		grid[ii][ij] = 1
grid[0][0] = grid[N + 1][N + 1] = 1
ans = []
for i in range(N + 2):
	for j in range(N + 2):
		if grid[i][j]:
			ans.append((i, j))
print(len(ans))
for (i, j) in ans:
	print(i, j)


from queue import Queue
n = int(input())
center = [500, 500]
if n == 1:
	print(7)
	nodes = [[2, 2], [1, 2], [3, 2], [2, 3], [2, 1], [1, 1], [3, 3]]
	for i in nodes:
		print(*i)
elif n % 2 == 0:
	start = [1, 3]
	nodes = []
	pattern = [[2, 3], [3, 3], [4, 3], [5, 3], [3, 2], [4, 2], [3, 4], [4, 4]]
	step = 4
	for i in range(n // 2):
		shift = step * i
		for j in pattern:
			nodes.append([j[0] + shift, j[1]])
	end = [2 + 4 * (n // 2), 3]
	nodes.append([start[0], start[1]])
	nodes.append([end[0], end[1]])
	for i in range(1, 4):
		start[1] += 1
		end[1] += 1
		nodes.append([start[0], start[1]])
		nodes.append([end[0], end[1]])
	while start[0] != end[0]:
		start[0] += 1
		nodes.append([start[0], start[1]])
	nodes.pop()
	print(len(nodes))
	for i in nodes:
		print(*i)
else:
	start = [1, 3]
	nodes = []
	pattern = [[2, 3], [3, 3], [4, 3], [5, 3], [3, 2], [4, 2], [3, 4], [4, 4]]
	step = 4
	for i in range(n // 2):
		shift = step * i
		for j in pattern:
			nodes.append([j[0] + shift, j[1]])
	end = [2 + 4 * (n // 2), 3]
	single = [[0, 0], [2, 0], [2, -1], [1, -1]]
	for j in single:
		nodes.append([end[0] + j[0], end[1] + j[1]])
	end = [end[0] + 1, end[1]]
	nodes.append([start[0], start[1]])
	nodes.append([end[0], end[1]])
	for i in range(1, 4):
		start[1] += 1
		end[1] += 1
		nodes.append([start[0], start[1]])
		nodes.append([end[0], end[1]])
	while start[0] != end[0]:
		start[0] += 1
		nodes.append([start[0], start[1]])
	nodes.pop()
	print(len(nodes))
	for i in nodes:
		print(*i)


k = int(input())
print(k + 6 + (k - 1) * 2)
for i in range(k + 2):
	if i == 0:
		print(i, i)
		print(i + 1, i)
	elif i != k + 1:
		print(i - 1, i)
		print(i, i)
		print(i + 1, i)
	else:
		print(i - 1, i)
		print(i, i)


n = int(input())
d = {}
ct = 0
(k, j) = (0, 0)
while True:
	k += 1
	j += 1
	if (k, j) not in d:
		d[k, j] = True
	if (k - 1, j) not in d:
		d[k - 1, j] = True
	if (k + 1, j) not in d:
		d[k + 1, j] = True
	if (k, j - 1) not in d:
		d[k, j - 1] = True
	if (k, j + 1) not in d:
		d[k, j + 1] = True
	if (k + 1, j + 1) not in d:
		d[k + 1, j + 1] = True
	if (k - 1, j - 1) not in d:
		d[k - 1, j - 1] = True
	ct += 1
	if ct == n:
		break
	if ct == n:
		break
print(len(d))
for i in d.keys():
	(a, b) = i
	print(a, b)


def draw(n):
	print(7 * n + 8)
	for i in range(n + 1):
		k = 2 * i
		print(*(k, k))
		print(*(k, k + 1))
		print(*(k, k + 2))
		print(*(k + 1, k))
		print(*(k + 2, k))
		print(*(k + 2, k + 1))
		print(*(k + 1, k + 2))
	print(*(2 * (n + 1), 2 * (n + 1)))
n = int(input())
draw(n)


n = int(input())
root = [2, 2]
print(4 + 3 * n)
print(0, 0)
print(0, 1)
print(1, 0)
print(1, 1)
for _ in range(n):
	print(root[0], root[1])
	print(root[0] - 1, root[1])
	print(root[0], root[1] - 1)
	root[0] += 1
	root[1] += 1


import math
n = int(input())
print(n * 3 + 4)
for i in range(n + 2):
	print(i, i)
for i in range(n + 1):
	print(i, i + 1)
	print(i + 1, i)


n = int(input())
a = []
p = 0
x = 0
y = 0
while p != n:
	if p == 0:
		a.append([x, y])
		a.append([x + 1, y])
		a.append([x, y + 1])
		a.append([x + 1, y + 1])
		a.append([x + 1, y + 2])
		a.append([x + 2, y + 1])
		x += 3
		y += 3
	else:
		a.append([x - 1, y - 1])
		a.append([x - 1, y])
		a.append([x, y - 1])
		x += 1
		y += 1
	p += 1
a.append([x - 1, y - 1])
print(len(a))
for j in a:
	print(*j)


for i in range(1):
	n = int(input())
	l = [[0, 0], [1, 0], [0, 1], [1, 1]]
	cnt = 1
	for i in range(n):
		l.append([cnt + 1, cnt])
		l.append([cnt, cnt + 1])
		l.append([cnt + 1, cnt + 1])
		cnt += 1
	print(len(l))
	for i in range(len(l)):
		print(l[i][0], l[i][1])


import math
i = int(input())
print(i * 3 + 4)
print(0, 0)
print(1, 0)
x = 0
y = 1
for a in range(0, i):
	print(x, y)
	print(x + 1, y)
	print(x + 2, y)
	x += 1
	y += 1
print(x, y)
print(x + 1, y)


import sys
input = sys.stdin.readline
n = int(input())
print(3 * n + 4)
print(0, 0)
for i in range(n + 1):
	print(i + 1, i + 1)
	print(i, i + 1)
	print(i + 1, i)


import os
import sys
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 fact(x):
	if x == 0:
		return 1
	else:
		return x * fact(x - 1)

def lower_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer

def upper_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] <= num:
			answer = middle
			start = middle + 1
		else:
			end = middle - 1
	return answer

def abs(x):
	return x if x >= 0 else -x

def binary_search(li, val, lb, ub):
	ans = 0
	while lb <= ub:
		mid = (lb + ub) // 2
		if li[mid] > val:
			ub = mid - 1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = 1
			break
	return ans

def sieve_of_eratosthenes(n):
	ans = []
	arr = [1] * (n + 1)
	(arr[0], arr[1], i) = (0, 0, 2)
	while i * i <= n:
		if arr[i] == 1:
			j = i + i
			while j <= n:
				arr[j] = 0
				j += i
		i += 1
	for k in range(n):
		if arr[k] == 1:
			ans.append(k)
	return ans

def nc2(x):
	if x == 1:
		return 0
	else:
		return x * (x - 1) // 2
from math import *
for _ in range(1):
	n = int(input())
	(x, y) = (0, 0)
	print(n * 3 + 4)
	print(x, y)
	print(x, y + 1)
	x = 1
	for i in range(n):
		print(x, y)
		print(x, y + 1)
		print(x, y + 2)
		x += 1
		y += 1
	print(x, y)
	print(x, y + 1)


n = int(input())
q = []
q.append([n + 1, 0])
q.append([n + 1, 1])
for i in range(n, 0, -1):
	q.append([i, n - i])
	q.append([i, n - i + 1])
	q.append([i, n - i + 2])
q.append([0, n])
q.append([0, n + 1])
print(3 * n + 4)
for i in q:
	print(*i)


import sys
input = sys.stdin.readline
N = int(input())
ans = []
if N % 2 == 0:
	MAX = N * 2 + 3
	for k in range(MAX):
		ans.append((0, k))
	ans += [(1, 0), (1, MAX - 1), (2, 0), (2, MAX - 1), (3, 0), (3, MAX - 1), (4, 0), (4, MAX - 1), (4, 1), (4, MAX - 2)]
	for k in range(2, MAX - 2):
		ans.append((4, k))
		if k % 4 != 1:
			ans.append((2, k))
			ans.append((6, k))
		if k % 2 == 0:
			ans.append((3, k))
			ans.append((5, k))
else:
	MAX = N * 2 + 3
	for k in range(MAX):
		ans.append((0, k))
		ans.append((8, k))
	ans += [(1, 0), (1, MAX - 1), (7, 0), (7, MAX - 1)]
	for k in range(MAX):
		ans.append((4, k))
		if k % 4 != 1:
			ans.append((2, k))
		if k % 4 != 3:
			ans.append((6, k))
		if k % 2 == 0:
			if k != MAX - 1:
				ans.append((3, k))
			if k != 0:
				ans.append((5, k))
print(len(ans))
for (a, b) in ans:
	print(a, b)


from sys import stdin
n = int(stdin.readline())
base = (0, 0)
lst = [base, (base[0] + 1, base[1]), (base[0], base[1] + 1), (base[0] + 1, base[1] + 1), (base[0] + 2, base[1] + 1), (base[0] + 1, base[1] + 2), (base[0] + 2, base[1] + 2)]
i = 2
n -= 1
while n:
	base = (i, i)
	n -= 1
	i += 1
	lst.append((base[0] + 1, base[1]))
	lst.append((base[0], base[1] + 1))
	lst.append((base[0] + 1, base[1] + 1))
print(len(lst))
for i in lst:
	print(f'{i[0]} {i[1]}')


n = int(input())
print(4 + n * 3)
starters = [[0, 0], [1, 0], [0, 1], [1, 1]]
for t in starters:
	print(*t)
start = [1, 1]
for t in range(n):
	print(*[start[0], start[1] + 1])
	print(*[start[0] + 1, start[1]])
	start = [start[0] + 1, start[1] + 1]
	print(*start)


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
sys.setrecursionlimit(int(pow(10, 6)))
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)]
for _ in range(1):
	n = l()[0]
	print(2 * (n + 1) + 2 + n)
	for i in range(n + 1):
		print(i, i)
	for i in range(n + 1):
		print(i, i + 1)
	for i in range(n + 1):
		print(i + 1, i)
	print(n + 1, n + 1)


n = int(input())
dp = [[0 for _ in range(n + 2)] for _ in range(n + 2)]
for i in range(n + 2):
	dp[i][i] = 1
for i in range(n + 1):
	dp[i + 1][i] = 1
for i in range(n + 1):
	dp[i][i + 1] = 1
k = 0
answ = []
for i in range(n + 2):
	for j in range(n + 2):
		if dp[i][j] == 1:
			k += 1
			answ.append((i, j))
print(k)
for line in answ:
	print(*line)


from math import ceil

def help():
	n = int(input())
	if n == 4:
		a = 5
		b = 5
		print(12)
		print(a - 1, b)
		print(a - 1, b + 1)
		print(a, b - 1)
		print(a, b)
		print(a, b + 1)
		print(a, b + 2)
		print(a + 1, b - 1)
		print(a + 1, b)
		print(a + 1, b + 1)
		print(a + 1, b + 2)
		print(a + 2, b)
		print(a + 2, b + 1)
		return
	print(4 + n * 3)
	a = 100000
	b = 100000
	print(a - 1, b)
	print(a - 1, b + 1)
	for i in range(n):
		print(a, b - 1)
		print(a, b)
		print(a, b + 1)
		a += 1
		b -= 1
	print(a, b)
	print(a, b + 1)
help()


K = int(input())
print((K - 1) * 3 + 7)
print('0 0')
print('0 1')
for i in range(1, K + 1):
	print('{} {}'.format(i, i - 1))
	print('{} {}'.format(i, i))
	print('{} {}'.format(i, i + 1))
print('{} {}'.format(K + 1, K))
print('{} {}'.format(K + 1, K + 1))


import sys
readline = sys.stdin.readline
read = sys.stdin.read
ns = lambda : readline().rstrip()
ni = lambda : int(readline().rstrip())
nm = lambda : map(int, readline().split())
nl = lambda : list(map(int, readline().split()))
prn = lambda x: print(*x, sep='\n')

def solve():
	n = ni()
	print(8 + 7 * n)
	for i in range(3 + n * 2):
		print(i, 2)
	for i in range(n + 1):
		print(i * 2, 3 - (i & 1) * 2)
		print(i * 2, 4 - (i & 1) * 4)
		print(i * 2 + 1, 4 - (i & 1) * 4)
		print(i * 2 + 2, 4 - (i & 1) * 4)
		print(i * 2 + 2, 3 - (i & 1) * 2)
	return
solve()


import os
import sys
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 inin():
	return int(input())

def inar():
	return list(map(int, input().split()))
from math import sqrt
Testcase = 1
for _ in range(Testcase):
	n = inin()
	print(n * 3 + 4)
	print(0, 0)
	print(0, 1)
	(a, b, c) = (0, 1, 2)
	for i in range(1, n + 1):
		print(i, a)
		print(i, b)
		print(i, c)
		a += 1
		b += 1
		c += 1
	print(n + 1, b - 1)
	print(n + 1, c - 1)


n = int(input())
indices = []
for i in range(n + 2):
	indices.append((i, i))
for i in range(n + 1):
	indices.append((i, i + 1))
for i in range(n + 1):
	indices.append((i + 1, i))
print(len(indices))
for (i, j) in indices:
	print(i, j)


n = int(input())
print(n + 1 + n + 2 + n + 1)
for x in range(n + 2):
	print(x, x)
for x in range(n + 1):
	print(x, x + 1)
	print(x + 1, x)


from fractions import Fraction
from collections import defaultdict
import math
import os
import sys
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))

def input():
	return sys.stdin.readline().rstrip('\r\n')
n = int(input())
l = [(0, 0), (0, 1), (1, 0), (1, 1), (2, 1), (1, 2), (2, 2)]
i = 1
j = 0
while n > 1:
	l.append((2 + j, 2 + i))
	l.append((2 + i, 2 + j))
	l.append((2 + i, 2 + i))
	i += 1
	j += 1
	n -= 1
print(len(l))
for i in l:
	print(*i)


n = int(input())
l = []
k = n + 2
for i in range(n + 2):
	for j in range(i - 1, i + 2):
		if j >= 0 and j < k:
			l.append((i, j))
print(len(l))
for i in range(len(l)):
	print(*l[i])


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

def lis():
	return list(map(int, input().split()))
n = int(input())
d = [[0, 0], [0, 1], [1, 0], [1, 1]]
for i in range(n):
	[x, y] = d[-1]
	d.append([x, y + 1])
	d.append([x + 1, y])
	d.append([x + 1, y + 1])
print(len(d))
for i in d:
	print(*i)


n = int(input())
print(3 * n + 4)
print(0, 0)
for i in range(1, n + 2):
	print(i - 1, i)
	print(i, i - 1)
	print(i, i)
num_inp = lambda : int(input())
arr_inp = lambda : list(map(int, input().split()))
sp_inp = lambda : map(int, input().split())
str_inp = lambda : input()


import sys
import math
from math import factorial, inf, gcd, sqrt
from heapq import *
from functools import *
from itertools import *
from collections import *
from typing import *
from bisect import *
import random
sys.setrecursionlimit(10 ** 5)

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

def f(ans):
	(x, y) = ans[-1]
	ans.append([x + 1, y])
	ans.append([x, y + 1])
	ans.append([x + 1, y + 1])
t = 1
for ii in range(t):
	n = int(input())
	ans = [[0, 0]]
	f(ans)
	for i in range(n):
		f(ans)
	print(len(ans))
	for (x, y) in ans:
		print(x, y)


import math
n = int(input())
print(n * 3 + 4)
for i in range(n + 2):
	for j in range(n + 1, -1, -1):
		if n + 1 - i == j:
			if j - 1 >= 0:
				print(i, j - 1)
			print(i, j)
			if j + 1 < n + 2:
				print(i, j + 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'
M = 10 ** 9 + 7
EPS = 1e-06

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()]

def GetSquare(i, j):
	a = (i + 1, j + 1)
	b = (i + 1, j)
	c = (i, j + 1)
	return (a, b, c)
n = Int()
ans = [(0, 0)]
x = 0
y = 0
for i in range(n + 1):
	elements = GetSquare(x, y)
	for i in elements:
		ans.append(i)
	x += 1
	y += 1
print(len(ans))
for i in ans:
	print(*i)


n = int(input())
x = 0
y = 0
print(4 + n * 3)

def cout(m, n):
	print(str(m) + ' ' + str(n))
cout(0, 0)
cout(1, 0)
cout(1, 1)
cout(0, 1)
cout(1, 2)
cout(2, 1)
for i in range(n - 1):
	cout(i + 2, i + 2)
	cout(i + 3, i + 2)
	cout(i + 2, i + 3)
cout(n + 1, n + 1)


n = int(input())
print(3 * n + 4)
out = []
out.append([0, 0])
for i in range(1, n + 1):
	out.append([i, i])
	if not [i + 1, i] in out:
		out.append([i + 1, i])
	if not [i - 1, i] in out:
		out.append([i - 1, i])
	if not [i, i + 1] in out:
		out.append([i, i + 1])
	if not [i, i - 1] in out:
		out.append([i, i - 1])
out.append([n + 1, n + 1])
for ans in out:
	print(ans[0], ans[1])


n = int(input())
print(8 + 7 * n)
print('0 0')
print('1 0')
print('2 0')
print('0 1')
print('0 2')
print('1 2')
print('2 1')
print('2 2')
for i in range(n):
	print(str(2 * i + 3) + ' ' + str(2 * i + 2))
	print(str(2 * i + 4) + ' ' + str(2 * i + 2))
	print(str(2 * i + 2) + ' ' + str(2 * i + 3))
	print(str(2 * i + 2) + ' ' + str(2 * i + 4))
	print(str(2 * i + 3) + ' ' + str(2 * i + 4))
	print(str(2 * i + 4) + ' ' + str(2 * i + 3))
	print(str(2 * i + 4) + ' ' + str(2 * i + 4))


import math
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
mod = 10 ** 9 + 7
mod1 = 998244353
import os
import sys
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')

class SegmentTree1:

	def __init__(self, data, default=9999999, func=lambda a, b: min(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: a + b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

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

def powm(a, n, m):
	if a == 1 or n == 0:
		return 1
	if n % 2 == 0:
		s = powm(a, n // 2, m)
		return s * s % m
	else:
		return a * powm(a, n - 1, m) % m

def sort_list(list1, list2):
	zipped_pairs = zip(list2, list1)
	z = [x for (_, x) in sorted(zipped_pairs)]
	return z

def product(l):
	por = 1
	for i in range(len(l)):
		por *= l[i]
	return por

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] <= key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def countGreater(arr, n, k):
	l = 0
	r = n - 1
	leftGreater = n
	while l <= r:
		m = int(l + (r - l) / 2)
		if arr[m] > k:
			leftGreater = m
			r = m - 1
		else:
			l = m + 1
	return n - leftGreater
k = int(input())
print((k - 1) * 3 + 7)
r = 598
c = 2
print(600, 0)
print(600, 1)
print(600 - 1, 0)
print(600 - 1, 1)
print(600 - 1, 2)
print(600 - 2, 1)
print(600 - 2, 2)
for i in range(k - 1):
	print(r - 1, c)
	print(r - 1, c + 1)
	print(r, c + 1)
	r -= 1
	c += 1


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import ceil, floor
from copy import *
from collections import deque, defaultdict
from collections import Counter as counter
from itertools import combinations
from itertools import permutations as permutate
from bisect import bisect_left as bl
from operator import *
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192
from sys import stderr

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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def fsep():
	return map(float, inp().split())

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def pow(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res
from functools import reduce

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

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

def prefix_sum(ar):
	return list(accumulate(ar))

def suffix_sum(ar):
	return list(accumulate(ar[::-1]))[::-1]
from collections import defaultdict

def numberOfSetBits(i):
	i = i - (i >> 1 & 1431655765)
	i = (i & 858993459) + (i >> 2 & 858993459)
	return ((i + (i >> 4) & 252645135) * 16843009 & 4294967295) >> 24

def solve():
	n = int(inp())
	ans = 0
	answer = []
	for i in range(1, n + 2):
		answer.append((i, i))
		answer.append((i + 1, i))
		answer.append((i, i + 1))
	answer.append((n + 2, n + 2))
	print(len(answer))
	for i in answer:
		print(*i)
solve()


from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush, heappop
import math
from collections import *
from functools import reduce, cmp_to_key
import sys
input = sys.stdin.readline
M = mod = 998244353

def factors(n):
	return sorted(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip('\n').split()]

def st():
	return input().rstrip('\n')

def val():
	return int(input().rstrip('\n'))

def li2():
	return [i for i in input().rstrip('\n')]

def li3():
	return [int(i) for i in input().rstrip('\n')]
n = val()
l = [(0, 0), (0, 1), (1, 0), (1, 1)]
k = 0
curr = 2
while k != n:
	l.append([curr, curr - 1])
	l.append([curr - 1, curr])
	l.append([curr, curr])
	curr += 1
	k += 1
print(len(l))
for i in l:
	print(*i)


import sys
input = sys.stdin.readline
f = lambda : list(map(int, input().split()))
n = int(input())
print((n + 1) * 3 + 1)
for i in range(n + 1):
	print(i, i)
	print(i, i + 1)
	print(i + 1, i)
print(n + 1, n + 1)


def solve(n):
	if n == 1:
		print(15)
		print(0, 0)
		print(1, 0)
		print(2, 0)
		print(0, 1)
		print(0, 2)
		print(1, 2)
		print(2, 1)
		print(2, 2)
		print(2, 3)
		print(2, 4)
		print(3, 2)
		print(3, 4)
		print(4, 2)
		print(4, 3)
		print(4, 4)
		return
	f = False
	mid = n // 2 - 1
	if n % 2 == 0:
		print(12 + 4 * n + mid * 2)
	else:
		n -= 1
		print(12 + 4 * n + 7 + mid * 2)
		f = True
	print(0, 0)
	print(1, 0)
	print(2, 0)
	print(3, 0)
	print(0, 1)
	print(3, 1)
	c = 0
	k = 0
	for i in range(n):
		print(3, 2 + i + k)
		print(2, 2 + i + k)
		print(4, 2 + i + k)
		print(0, 2 + i + k)
		c += 1
		if c == 2 and i != n - 1:
			print(3, 2 + i + 1 + k)
			print(0, 2 + i + 1 + k)
			k += 1
			c = 0
	print(3, 2 + n + k)
	print(3, 2 + n + 1 + k)
	print(2, 2 + n + 1 + k)
	print(1, 2 + n + 1 + k)
	print(0, 2 + n + 1 + k)
	print(0, 2 + n + k)
	if f:
		print(3, 2 + n + k + 2)
		print(3, 2 + n + 3 + k)
		print(4, 2 + n + 1 + k)
		print(5, 2 + n + 1 + k)
		print(5, 2 + n + 2 + k)
		print(5, 2 + n + 3 + k)
		print(4, 2 + n + 3 + k)
n = int(input())
res = solve(n)


n = int(input())
max_x = n + 1
print(7 if n == 1 else 7 + 3 * (n - 1))
for x in range(max_x):
	print(f'{x} {x}')
	print(f'{x + 1} {x}')
	print(f'{x} {x + 1}')
else:
	print(f'{max_x} {max_x}')


n = int(input())
print(3 * n + 4)
for i in range(n + 2):
	print(str(i) + ' ' + str(i))
for i in range(n + 1):
	print(str(i + 1) + ' ' + str(i))
for i in range(n + 1):
	print(str(i) + ' ' + str(i + 1))


def f(x):
	u.append((x, x + 1))
	u.append((x + 1, x))
	u.append((x, x + 2))
	u.append((x + 2, x))
	u.append((x + 1, x + 2))
	u.append((x + 2, x + 1))
	u.append((x + 2, x + 2))
k = int(input())
u = [(0, 0)]
f(0)
for i in range(2, 2 * k + 1, 2):
	f(i)
for i in range(len(u)):
	u[i] = str(u[i][0]) + ' ' + str(u[i][1])
print(len(u))
print('\n'.join(u))


N = int(input())
K = 3 * N + 4
print(K)
print('0 0')
print('0 1')
print('1 0')
print('1 1')
top_right = (1, 1)
for _ in range(N):
	print(' '.join([str(top_right[0]), str(top_right[1] + 1)]))
	print(' '.join([str(top_right[0] + 1), str(top_right[1])]))
	print(' '.join([str(top_right[0] + 1), str(top_right[1] + 1)]))
	top_right = (top_right[0] + 1, top_right[1] + 1)


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()
diagonal = []
ans = set()
for i in range(n + 2):
	diagonal.append((i, i))
	ans.add((i, i))
dx = [1, -1, 0, 0]
dy = [0, 0, 1, -1]
for i in range(1, n + 1):
	point = diagonal[i]
	for i in range(4):
		ans.add((point[0] + dx[i], point[1] + dy[i]))
print(len(ans))
for point in ans:
	print(*point)


n = int(input())
k = 7 * n + 8
print(k)
print(0, 2)
print(0, 3)
print(0, 4)
if n % 2 == 0:
	print(2 * (n + 1), 2)
	print(2 * (n + 1), 3)
	print(2 * (n + 1), 4)
else:
	print(2 * (n + 1), 2)
	print(2 * (n + 1), 0)
	print(2 * (n + 1), 1)
for i in range(1, 2 * (n + 1)):
	if i % 2 == 0:
		for j in range(5):
			print(i, j)
	elif (i + 1) % 4 == 0:
		print(i, 2)
		print(i, 0)
	else:
		print(i, 2)
		print(i, 4)


from collections import deque
import sys
import math

def inp():
	return sys.stdin.readline().strip()
n = int(inp())
s = set()
for i in range(1, n + 1):
	s.add((i, i))
	s.add((i - 1, i))
	s.add((i + 1, i))
	s.add((i, i + 1))
	s.add((i, i - 1))
	s.add((i - 1, i - 1))
	s.add((i + 1, i + 1))
print(len(s))
for i in s:
	print(i[0], i[1])


import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
n = int(input())
path = [[0, 0], [n + 1, n + 1]]
for i in range(1, n + 1):
	path.append([i, i])
for i in range(n + 1):
	path.append([i, i + 1])
	path.append([i + 1, i])
print(len(path))
for i in path:
	print(*i)


def solve():
	n = int(input())
	total = 3 * n + 4
	points = [[0, 0], [0, 1], [1, 0], [1, 1], [1, 2], [2, 1], [2, 2]]
	last_x = 2
	last_y = 2
	print(total)
	for i in points:
		print(*i)
	for i in range(n - 1):
		print(last_x + 1, last_y)
		print(last_x, last_y + 1)
		print(last_x + 1, last_y + 1)
		last_x += 1
		last_y += 1
t = 1
for _ in range(t):
	solve()


n = int(input())
i = -2
ar = []
ar.append([i, 0])
ar.append([i, 1])
ar.append([i, 2])
ar.append([i + 1, 2])
ar.append([i + 2, 2])
ar.append([i + 2, 1])
ar.append([i + 2, 0])
ar.append([i + 1, 0])
i += 2
ar.append([i + 1, 0])
ar.append([i + 2, 0])
ar.append([i + 2, -1])
ar.append([i + 2, -2])
ar.append([i + 1, -2])
ar.append([i, -2])
ar.append([i, -1])
i = 2
hihi = 0
n -= 1
while n > 0:
	if hihi == 0:
		ar.append([i, 1])
		ar.append([i, 2])
		ar.append([i + 1, 2])
		ar.append([i + 2, 2])
		ar.append([i + 2, 1])
		ar.append([i + 2, 0])
		ar.append([i + 1, 0])
		hihi = 1
	else:
		ar.append([i + 1, 0])
		ar.append([i + 2, 0])
		ar.append([i + 2, -1])
		ar.append([i + 2, -2])
		ar.append([i + 1, -2])
		ar.append([i, -2])
		ar.append([i, -1])
		hihi = 0
	n -= 1
	i += 2
print(len(ar))
for elem in ar:
	print(*elem)


n = int(input())

def func(n):
	coordinates = [[0, 0], [0, 1], [0, 2], [1, 2], [1, 0], [2, 0], [2, 1], [2, 2], [2, 3], [2, 4], [3, 2], [4, 2], [4, 3], [3, 4], [4, 4]]
	for i in range(n - 1):
		newcoordinates = [[coordinates[-1][0] + 1, coordinates[-1][1]], [coordinates[-1][0] + 2, coordinates[-1][1]], [coordinates[-1][0] + 2, coordinates[-1][1] + 1], [coordinates[-1][0], coordinates[-1][1] + 1], [coordinates[-1][0], coordinates[-1][1] + 2], [coordinates[-1][0] + 1, coordinates[-1][1] + 2], [coordinates[-1][0] + 2, coordinates[-1][1] + 2]]
		coordinates = coordinates + newcoordinates
	print(len(coordinates))
	for i in coordinates:
		print(*i)
func(n)


import os
from sys import stderr
from math import sqrt, ceil
n = int(input())
k = ceil(sqrt(n))
(x, y) = (0, 0)
i = 1
j = 1
c = 1
d = 0
li = (3 * n + 4) * [None]
s = '{} {}'
li[0] = s.format(-1, -1)
li[1] = s.format(0, -1)
for i in range(n):
	li[2 + 3 * i] = s.format(x - 1, y)
	li[2 + 3 * i + 1] = s.format(x, y)
	li[2 + 3 * i + 2] = s.format(x + 1, y)
	x += 1
	y += 1
li[3 * n + 2] = s.format(x, y)
li[3 * n + 3] = s.format(x - 1, y)
out = str(3 * n + 4) + '\n'
out += '\n'.join(li)
out = out.encode(encoding='UTF-8')
os.write(1, out)


from collections import defaultdict as dd
import math
import sys
input = sys.stdin.readline

def nn():
	return int(input())

def li():
	return list(input())

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

def lm():
	return list(map(int, input().split()))
n = nn()
print(3 * n + 4)
print(0, 0)
for i in range(n + 1):
	print(i + 1, i)
	print(i, i + 1)
	print(i + 1, i + 1)


from sys import stdin
import math
A = int(stdin.readline())
print(3 * A + 4)
move = 1
print(0, 0)
print(1, 0)
for k in range(0, A):
	print(k, move)
	print(k + 1, move)
	print(k + 2, move)
	move += 1
print(A, move)
print(A + 1, move)


def cout(i):
	print(str(i - 1) + ' ' + str(i))
	print(str(i) + ' ' + str(i - 1))
	print(str(i) + ' ' + str(i))
n = int(input())
print(4 + n * 3)
print('0 0')
for i in range(1, n + 2):
	cout(i)


import sys
fast_reader = sys.stdin.readline
fast_writer = sys.stdout.write

def input():
	return fast_reader().strip()

def print(*argv):
	fast_writer(' '.join((str(i) for i in argv)))
	fast_writer('\n')

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

def sep_input():
	return map(int, input().split())
n = int(input())
print(4 + 3 * n)
print(0, 0)
print(0, 1)
print(1, 0)
print(1, 1)
for i in range(2, n + 2):
	print(i, i)
	print(i - 1, i)
	print(i, i - 1)


from collections import deque
rr = lambda : input()
rri = lambda : int(input())
rrm = lambda : list(map(int, input().split()))
INF = float('inf')

def solve(N):
	print(1 + 3 * (n + 1))
	print(-1, -1)
	for i in range(n + 1):
		print(i, i)
		print(i, i - 1)
		print(i - 1, i)
n = rri()
solve(n)


a = int(input())
print(3 * a + 4)
for i in range(a + 2):
	print(i, i)
for i in range(a + 1):
	print(i + 1, i)
	print(i, i + 1)


import sys
import math

def II():
	return int(sys.stdin.readline())

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

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

def SI():
	return sys.stdin.readline().strip()
t = II()
if t % 2 == 0:
	ans = []
	a = 7
	b = 3 * t + 2
	for j in range(2, b, 6):
		ans.append((0, j))
		ans.append((1, j))
		ans.append((1, j + 3))
		ans.append((0, j + 1))
		ans.append((0, j + 2))
		ans.append((0, j + 3))
		ans.append((4, j))
		ans.append((4, j + 1))
		ans.append((4, j + 2))
		ans.append((4, j + 3))
		ans.append((3, j))
		ans.append((3, j + 3))
	for i in range(a):
		for j in range(b):
			if (j == 0 or j == b - 1) and i > 2:
				ans.append((i, j))
			if i == 2:
				ans.append((2, j))
			if i == a - 1:
				ans.append((i, j))
	ans = list(set(ans))
	print(len(ans))
	for i in ans:
		print(i[0], i[1])
else:
	ans = []
	a = 7
	b = t * 3 + 2
	for i in range(a):
		for j in range(b):
			if i == 2:
				ans.append((2, j))
			if j == 0 and i > 2:
				ans.append((i, j))
			if i == 6 and j < b - 2:
				ans.append((i, j))
			if j == b - 3:
				ans.append((i, j))
			if j == b - 1 and i < 2:
				ans.append((i, j))
			ans.append((0, b - 2))
	for j in range(2, b - 4, 6):
		ans.append((0, j))
		ans.append((1, j))
		ans.append((1, j + 3))
		ans.append((0, j + 1))
		ans.append((0, j + 2))
		ans.append((0, j + 3))
		ans.append((4, j))
		ans.append((4, j + 1))
		ans.append((4, j + 2))
		ans.append((4, j + 3))
		ans.append((3, j))
		ans.append((3, j + 3))
	ans = list(set(ans))
	print(len(ans))
	for i in ans:
		print(i[0], i[1])


n = int(input(''))
str = {}
str[0, 0] = 0
str[1, 0] = 0
cnt = 0
for i in range(1, n + 1, 1):
	str[cnt, i] = 0
	str[cnt + 1, i] = 0
	str[cnt + 2, i] = 0
	cnt = cnt + 1
str[cnt, n + 1] = 0
str[cnt + 1, n + 1] = 0
str = list(str.keys())
print(len(str))
for i in range(len(str)):
	print(str[i][0], str[i][1])


n = int(input())
ans1 = []
x = 0
y = 0
i = 1
l = []
l.append(0)
l.append(0)
ans1.append(l)
nn = n
while n:
	ans = []
	l = []
	y += 1
	x += 1
	l.append(x)
	l.append(y)
	ans.append(l)
	l = []
	l.append(x + 1)
	l.append(y)
	ans.append(l)
	l = []
	l.append(x)
	l.append(y + 1)
	ans.append(l)
	l = []
	l.append(x - 1)
	l.append(y)
	ans.append(l)
	l = []
	l.append(x)
	l.append(y - 1)
	ans.append(l)
	n -= 1
	for j in ans:
		if j not in ans1:
			ans1.append(j)
l = []
l.append(nn + 1)
l.append(nn + 1)
ans1.append(l)
print(len(ans1))
for i in ans1:
	print(i[0], i[1])


n = int(input())
k = 0
u = n * 3 + 4
print(u)
print(0, 0)
print(1, 0)
for y in range(1, n + 1):
	for x in range(k, k + 3):
		print(x, y)
	k += 1
print(n, n + 1)
print(n + 1, n + 1)


k = int(input())
n = 2
m = 2
x = 7
inc = k - 1
n += inc
m += inc
arr = [[0, m], [0, m - 1], [n, 0], [n, 1]]
c = 0
for i in range(1, n):
	for j in range(3):
		arr.append([i, m - j - c])
	c += 1
print(7 + 3 * inc)
for i in arr:
	print(*i)


from bisect import *
from collections import *
from math import *
from heapq import *
from typing import List
from itertools import *
from operator import *
from functools import *

@lru_cache(None)
def fact(x):
	if x < 2:
		return 1
	return fact(x - 1) * x

@lru_cache(None)
def per(i, j):
	return fact(i) // fact(i - j)

@lru_cache(None)
def com(i, j):
	return per(i, j) // fact(j)

def linc(f, t, l, r):
	while l < r:
		mid = (l + r) // 2
		if t > f(mid):
			l = mid + 1
		else:
			r = mid
	return l

def rinc(f, t, l, r):
	while l < r:
		mid = (l + r + 1) // 2
		if t < f(mid):
			r = mid - 1
		else:
			l = mid
	return l

def ldec(f, t, l, r):
	while l < r:
		mid = (l + r) // 2
		if t < f(mid):
			l = mid + 1
		else:
			r = mid
	return l

def rdec(f, t, l, r):
	while l < r:
		mid = (l + r + 1) // 2
		if t > f(mid):
			r = mid - 1
		else:
			l = mid
	return l

def isprime(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return False
	return True

def power2(n):
	while not n & 1:
		n >>= 1
	return n == 1
n = int(input())
print(3 * n + 4)
print(0, 0)
for i in range(n + 1):
	print(i, i + 1)
	print(i + 1, i)
	print(i + 1, i + 1)


from sys import stdin, stdout
n = int(stdin.readline())
stdout.write(str(3 * (n + 1) + 1) + '\n')
stdout.write('1 1\n')
for x in range(2, n + 3):
	stdout.write(str(x) + ' ' + str(x - 1) + '\n')
	stdout.write(str(x - 1) + ' ' + str(x) + '\n')
	stdout.write(str(x) + ' ' + str(x) + '\n')


from copy import *
from math import *

def multiplyList(myList):
	result = 1
	for x in myList:
		result = result * x
	return result
n = int(input())
print(7 + (n - 1) * 3)
l = [[0, 0], [1, 0], [0, 1], [1, 1], [2, 1]]
for i in range(n):
	a = i + 1
	b = a + 1
	c = b + 1
	l.append([a, b])
	l.append([b, b])
	l.append([c, b])
for i in range(len(l) - 1):
	print(l[i][0], l[i][1])


n = int(input())
ans = set()
for i in range(n + 1):
	ans.add((i, i))
	ans.add((i + 1, i + 1))
	ans.add((i, i + 1))
	ans.add((i + 1, i))
print(len(ans))
ans = list(ans)
for i in range(len(ans)):
	print(ans[i][0], ans[i][1])


production = True
import sys, math, collections

def input(input_format=0, multi=0):
	if multi > 0:
		return [input(input_format) for i in range(multi)]
	else:
		next_line = sys.stdin.readline()[:-1]
		if input_format >= 10:
			use_list = False
			input_format = int(str(input_format)[-1])
		else:
			use_list = True
		if input_format == 0:
			formatted_input = [next_line]
		elif input_format == 1:
			formatted_input = list(map(int, next_line.split()))
		elif input_format == 2:
			formatted_input = list(map(float, next_line.split()))
		elif input_format == 3:
			formatted_input = next_line.split()
		elif input_format == 4:
			formatted_input = (lambda x: [x[0], list(map(int, x[1:]))])(next_line.split())
		elif input_format == 5:
			formatted_input = (lambda x: [x[0], list(map(float, x[1:]))])(next_line.split())
		else:
			formatted_input = [next_line]
		return formatted_input if use_list else formatted_input[0]

def out(output_line, output_format=0, newline=True):
	formatted_output = ''
	if output_format == 0:
		formatted_output = str(output_line)
	elif output_format == 1:
		formatted_output = ' '.join(map(str, output_line))
	elif output_format == 1:
		formatted_output = '\n'.join(map(str, output_line))
	print(formatted_output, end='\n' if newline else '')

def log(*args):
	if not production:
		print('$$$', end='')
		print(*args)
enum = enumerate

def solve():
	n = input(11)
	d0 = ['...', '...', '###', '#.#', '###']
	d1 = ['###', '#.#', '.##', '...', '...']
	d2 = ['...', '...', '.##', '#.#', '###']
	out(8 + 7 * n)
	for y in range(5):
		for x in range(3):
			if d0[y][x] == '#':
				out([x, y], 1)
	for i in range(1, n + 1):
		for y in range(5):
			for x in range(3):
				t = d1 if i % 2 else d2
				if t[y][x] == '#':
					out([x + i * 2, y], 1)
	return
solve()


import sys
input = sys.stdin.readline
from math import ceil, floor, factorial

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

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

def nCr(n, k):
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def upper_bound(a, x, lo=0):
	hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(1000000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

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

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
n = int(input())
ans = set()
for i in range(2, n + 2):
	ans.add((i, i))
	ans.add((i - 1, i))
	ans.add((i + 1, i))
	ans.add((i, i - 1))
	ans.add((i, i + 1))
ans.add((1, 1))
ans.add((n + 2, n + 2))
print(len(ans))
for i in ans:
	print(*i)


from sys import stdin, stdout
Pi = lambda x: stdout.write(str(x) + '\n')
Ps = lambda x: stdout.write(str(x))
S = lambda x: x * (x + 1) // 2
I = lambda x: 1 + 2 * x
R = lambda : stdin.readline()
Ri = lambda x: map(int, x.split())
Rs = lambda x: map(str, x.split())
Rf = lambda x: map(float, x.split())
char = lambda x, y: ord(x) - ord(y)
gcd = lambda a, b: a if b == 0 else gcd(b, a % b)
lcm = lambda a, b: a * b // gcd(a, b)
distance = lambda a, b, c, d: (a - c) ** 2 + (b - d) ** 2
MaxN = int(1000000.0) + 10
mod = int(1000000000.0) + 7
(fx, fy) = ([0, 0, -1, 1], [1, -1, 0, 0])

def main():
	for x in stdin:
		if x == '\n':
			continue
		n = int(x)
		A = set()
		(x, y) = (1, 1)
		for i in range(n):
			A.add((x, y))
			for j in range(4):
				(a, b) = (x + fx[j], y + fy[j])
				A.add((a, b))
			y += 1
			x += 1
		A.add((0, 0))
		A.add((x, y))
		Pi(len(A))
		for x in A:
			Pi(str(x[1]) + ' ' + str(x[0]))
main()


n = int(input())
arr = []
for i in range(n + 2):
	s = [0] * (n + 2)
	arr.append(s)
ans = 0
coordinates = []
for i in range(1, n + 1):
	arr[i][i] = 1
	coordinates.append([i, i])
	arr[i + 1][i] = 1
	coordinates.append([i + 1, i])
	arr[i][i + 1] = 1
	coordinates.append([i, i + 1])
arr[0][0] = 1
arr[0][1] = 1
arr[1][0] = 1
arr[n + 1][n + 1] = 1
coordinates.append([0, 0])
coordinates.append([0, 1])
coordinates.append([1, 0])
coordinates.append([n + 1, n + 1])
print(len(coordinates))
for i in coordinates:
	print(*i)


import sys
import math
import operator as op
from functools import reduce
from bisect import *
from collections import OrderedDict
from collections import deque

def read_line():
	return sys.stdin.readline()[:-1]

def read_int():
	return int(sys.stdin.readline())

def read_int_line():
	return [int(v) for v in sys.stdin.readline().split()]

def read_float_line():
	return [float(v) for v in sys.stdin.readline().split()]

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer / denom

def index(a, x):
	i = bisect_left(a, x)
	if i != len(a) and a[i] == x:
		return i
	return -1

def find_lt(a, x):
	i = bisect_left(a, x)
	if i:
		return i - 1
	return -1

def find_le(a, x):
	i = bisect_right(a, x)
	if i:
		return i - 1
	return -1

def find_gt(a, x):
	i = bisect_right(a, x)
	if i != len(a):
		return i
	return -1

def find_ge(a, x):
	i = bisect_left(a, x)
	if i != len(a):
		return i
	return -1
mod = int(1000000000.0) + 7
mod2 = 998244353
t = 1
for i in range(t):
	n = read_int()
	print(3 * n + 4)
	ans = []
	ans.append([1, 1])
	ans.append([1, 2])
	for i in range(2, n + 2):
		for j in range(i - 1, i + 2):
			ans.append([i, j])
	ans.append([i + 1, j - 1])
	ans.append([i + 1, j])
	for i in range(len(ans)):
		print(*ans[i])


n = int(input())
a = [[0] * (2 * n) for i in range(2 * n)]
k = 0
if n == 1:
	print(7)
	print(0, 0)
	print(0, 1)
	print(1, 0)
	print(1, 1)
	print(1, 2)
	print(2, 1)
	print(2, 2)
	exit()
for i in range(n + 1):
	a[i][i] = 1
	a[i][i + 1] = 1
	a[i + 1][i] = 1
	a[i + 1][i + 1] = 1
for i in range(len(a)):
	k += a[i].count(1)
print(k)
for i in range(len(a)):
	for j in range(len(a)):
		if a[i][j] == 1:
			print(i, j)


import sys

def solve(n):
	k = 4 + 3 * n
	print(k)
	print('0 0')
	for i in range(n + 1):
		print(i, i + 1)
		print(i + 1, i)
		print(i + 1, i + 1)
IN = [x.strip() for x in sys.stdin.readlines()]
n = int(IN[0])
solve(n)


grid = []
for _ in range(5):
	grid += [[' '] * 5000]

def draw(x, y):
	for i in range(x, x + 3):
		for j in range(y, y + 3):
			grid[i][j] = 'X'
	grid[x + 1][y + 1] = ' '
N = int(input())
draw(0, 0)
for t in range(1, N + 1):
	y = 2 * t
	if t % 2 == 1:
		x = 2
	else:
		x = 0
	draw(x, y)
K = 0
for x in range(5):
	for y in range(5000):
		if grid[x][y] == 'X':
			K += 1
print(K)
for x in range(5):
	for y in range(5000):
		if grid[x][y] == 'X':
			print(f'{x} {y}')


n = int(input())

def asquare(x):
	return [(x + 1, x), (x + 2, x), (x, x + 1), (x + 2, x + 1), (x, x + 2), (x + 1, x + 2), (x + 2, x + 2)]
ans = [(0, 0)]
for i in range(n + 1):
	ans += asquare(2 * i)
print(len(ans))
for (x, y) in ans:
	print(x, y)


n = int(input())
ans = set()
for i in range(n + 1):
	ans.add((i + 1, i + 1))
	ans.add((i + 0, i + 1))
	ans.add((i + 1, i + 0))
	ans.add((i + 0, i + 0))
print(len(ans))
for x in ans:
	(a, b) = x
	print(a, b)


(n, x, y) = (int(input()), 0, 0)
print(3 * n + 4)
for i in range(3 * n + 4):
	print(x, y)
	if x == y:
		y += 1
	elif x < y:
		(x, y) = (y, x)
	else:
		y = x


n = int(input())
print((n + 1) * 2 + 1 + 5 * (n + 1))
c = 0
l = [[(2, c + 1), (0, 1)], [(2, c + 1), (1, c + 1), (0, 1), (-1, c + 1), (-2, c + 1)], [(-2, c + 1), (0, 1)], [(2, c + 1), (1, c + 1), (0, 1), (-1, c + 1), (-2, c + 1)]]
for i in range((n + 1) * 2 + 1):
	if i == 0:
		print(0, 0)
		print(1, 0)
		print(2, 0)
	elif i == (n + 1) * 2:
		if not n % 2:
			print(0, c + 1)
			print(1, c + 1)
			print(2, c + 1)
		else:
			print(0, c + 1)
			print(-1, c + 1)
			print(-2, c + 1)
	else:
		for i in l[c % 4]:
			print(i[0], i[1] + c)
		c += 1


from fractions import Fraction
import bisect
import os
import io
from collections import Counter
import bisect
from collections import defaultdict
import math
import random
import heapq as hq
from math import sqrt
import sys
from functools import reduce, cmp_to_key
from collections import deque
import threading
from itertools import combinations
from io import BytesIO, IOBase
from itertools import accumulate
from queue import Queue

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

def iinput():
	return int(input())

def tinput():
	return input().split()

def rinput():
	return map(int, tinput())

def rlinput():
	return list(rinput())
mod = int(1000000000.0) + 7

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))
t = 1
t = iinput()
print(3 * t + 4)
(x1, x2, x3) = (1, 2, 2)
(y1, y2, y3) = (2, 2, 1)
print(0, 0)
print(0, 1)
print(1, 1)
print(1, 0)
for i in range(t):
	print(x1, y1)
	print(x2, y2)
	print(x3, y3)
	x1 += 1
	x2 += 1
	x3 += 1
	y1 += 1
	y2 += 1
	y3 += 1


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__
k = int(input())
print(4 + 3 * k)
print(0, 0)
print(1, 0)
print(1, 1)
print(0, 1)
for x in range(2, k + 2):
	print(x, x - 1)
	print(x, x)
	print(x - 1, x)


n = int(input())
coords = []
if n == 0:
	print(0)
else:
	coords = [[0, 1], [1, 1], [1, 0], [0, 0]]
	count = 4
	for i in range(1, n + 1):
		coords.append((i + 1, i + 1))
		coords.append((i, i + 1))
		coords.append((i + 1, i))
		count += 3
	print(count)
	for coord in coords:
		print(' '.join(list(map(str, coord))))


def gns():
	return list(map(int, input().split()))
k = int(input())
ans = set()
if k % 2 == 1:
	ans = set([(0, 0), (0, 1), (0, 2), (1, 0), (2, 0), (1, 2), (2, 1)])
	k -= 1
l = 2000
for i in range(2, l + 1):
	ans.add((2, i))
	ans.add((5, i))
ans.add((3, 2))
ans.add((4, 2))
ans.add((3, l))
ans.add((4, l))
for i in range(k // 2):
	j = i * 3 + 4
	k = j + 1
	ans.add((1, j))
	ans.add((1, k))
	ans.add((3, j))
	ans.add((3, k))
print(len(ans))
for (i, j) in ans:
	print(i, j)


import sys
import random
from math import *

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

def iinput():
	return int(input())

def finput():
	return float(input())

def tinput():
	return input().split()

def linput():
	return list(input())

def rinput():
	return map(int, tinput())

def fiinput():
	return map(float, tinput())

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

def trinput():
	return tuple(rinput())

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

def YESNO(fl):
	if fl:
		print('NO')
	else:
		print('YES')

def main():
	k = iinput()
	print(3 * k + 4)
	print(1, 2)
	print(2, 2)
	print(2, 1)
	for i in range(3, k + 2):
		print(i - 1, i)
		print(i, i)
		print(i, i - 1)
	print(0, 0)
	print(0, 1)
	print(1, 0)
	print(1, 1)
for inytd in range(1):
	main()


def solve():
	n = int(input())
	print(3 * (n + 1) + 1)
	for i in range(n + 1):
		print(i, i)
		print(i + 1, i)
		print(i, i + 1)
	print(n + 1, n + 1)
solve()


from sys import *
n = int(input())
k = 3 * n + 4
print(k)
print(1, 0)
print(2, 0)
(i, j) = (1, 1)
for m in range(n):
	print(i, j)
	print(i + 1, j)
	print(i + 2, j)
	i = i + 1
	j = j + 1
print(i, j)
print(i + 1, j)


import math

def main():
	t = int(input())
	print(4 + t * 3)
	print(0, 0)
	print(0, 1)
	for j in range(t):
		print(j + 1, j)
		print(j + 1, j + 1)
		print(j + 1, j + 2)
	print(t + 1, t)
	print(t + 1, t + 1)
main()


n = int(input())
print(4 + n * 3)
print(0, 0)
print(1, 0)
for i in range(n + 1):
	for j in range(3):
		if i == n and j == 2:
			break
		print(i + j, i + 1)


n = int(input())

def grey(k):
	if k == 1:
		A = [[0, 0], [1, 0], [0, 1], [1, 1], [2, 1], [1, 2], [2, 2]]
		return A
	else:
		B = grey(k - 1)
		M = max(B)
		(a, b) = (M[0], M[1])
		B.append([a + 1, b + 1])
		B.append([a + 1, b])
		B.append([a, b + 1])
		return B
X = grey(n)
print(len(X))
for i in X:
	print(i[0], i[1])


n = int(input())
ans = 0
if n % 2 == 0:
	k = n // 2
	i = 0
	ans = 15 * k + 5 + 4 + 5 * k + 1
	print(ans)
	while i < k:
		t = i * 5
		print(t, 0)
		print(t + 1, 0)
		print(t + 2, 0)
		print(t + 3, 0)
		print(t + 4, 0)
		print(t + 1, -1)
		print(t + 3, -1)
		print(t + 1, 1)
		print(t + 3, 1)
		print(t + 1, 2)
		print(t + 2, 2)
		print(t + 3, 2)
		print(t + 1, -2)
		print(t + 2, -2)
		print(t + 3, -2)
		i += 1
	print(-1, 0)
	print(-1, 1)
	print(-1, 2)
	print(-1, 3)
	print(-1, 4)
	for i in range(0, k * 5 + 1):
		print(i, 4)
	print(k * 5, 2)
	print(k * 5, 1)
	print(k * 5, 0)
	print(k * 5, 3)
else:
	k = n // 2
	i = 0
	ans = 15 * k + 19 + k * 5 + 1 + 5
	print(ans)
	while i < k:
		t = i * 5
		print(t, 0)
		print(t + 1, 0)
		print(t + 2, 0)
		print(t + 3, 0)
		print(t + 4, 0)
		print(t + 1, -1)
		print(t + 3, -1)
		print(t + 1, 1)
		print(t + 3, 1)
		print(t + 1, 2)
		print(t + 2, 2)
		print(t + 3, 2)
		print(t + 1, -2)
		print(t + 2, -2)
		print(t + 3, -2)
		i += 1
	print(-1, 0)
	print(-1, 1)
	print(-1, 2)
	print(-1, 3)
	print(-1, 4)
	print(-1, 5)
	print(-1, 6)
	print(-1, 7)
	print(0, 7)
	print(1, 7)
	print(1, 6)
	print(1, 5)
	print(-2, 7)
	print(-3, 7)
	print(-3, 8)
	print(-3, 9)
	print(-2, 9)
	print(-1, 9)
	print(-1, 8)
	for i in range(1, k * 5 + 2):
		print(i, 4)
	print(k * 5 + 1, 2)
	print(k * 5 + 1, 1)
	print(k * 5 + 1, 0)
	print(k * 5 + 1, 3)
	if k == 0:
		print(0, 0)
	else:
		print(5 * k, 0)


def read_int():
	return int(input().strip())

def read_ints():
	return list(map(int, input().strip().split(' ')))

def coords(n):
	for i in range(3):
		for j in range(3):
			if i == 1 and j == 1:
				continue
			yield (i, j)
	for i in range(2, 5):
		for j in range(2, 5):
			if i == 2 and j == 2 or (i == 3 and j == 3):
				continue
			yield (i, j)
	n -= 1
	d = 0
	x = 4
	while n != 0:
		if d == 0:
			for i in range(3):
				for j in range(x, x + 3):
					if i == 2 and j == x or (i == 1 and j == x + 1):
						continue
					yield (i, j)
		else:
			for i in range(2, 5):
				for j in range(x, x + 3):
					if i == 2 and j == x or (i == 3 and j == x + 1):
						continue
					yield (i, j)
		x += 2
		d = (d + 1) % 2
		n -= 1

def solve():
	n = read_int()
	table = [['.'] * 40 for _ in range(5)]
	cs = list(coords(n))
	print(len(cs))
	for row in cs:
		print(row[0], row[1])
solve()


li = [(1, 0), (2, 0), (2, 1), (2, 2), (1, 2), (0, 2), (0, 1)]
n = int(input())
k = 1 + len(li) * (n + 1)
print(k)
print('0 0')
for i in range(n + 1):
	step = 2 * i
	for (x, y) in li:
		print('%d %d' % (step + x, step + y))


n = int(input())
ans = 7 + (n - 1) * 3
print(ans)
i = 0
j = 0
print(i, j)
while 1:
	print(i, j + 1)
	print(i + 1, j)
	print(i + 1, j + 1)
	if i == n and j == n:
		break
	i -= -1
	j -= -1


n = int(input())
k = 4 + 3 * n
print(k)
print('{} {}'.format(0, 0))
print('{} {}'.format(1, 0))
print('{} {}'.format(0, 1))
print('{} {}'.format(1, 1))
x = 1
y = 1
for i in range(n):
	print('{} {}'.format(x + 1, y))
	print('{} {}'.format(x, y + 1))
	print('{} {}'.format(x + 1, y + 1))
	x += 1
	y += 1


n = int(input())
print(8 + 7 * n)
for row in range(0, 3 + 2 * n):
	for col in range(0, 5):
		if row == 0:
			if col > 1:
				print(row, col)
		elif row == 2 + 2 * n:
			if n % 2 == 0:
				if col > 1:
					print(row, col)
			elif col < 3:
				print(row, col)
		elif row % 2 != 0:
			if (row + 1) % 4 == 0:
				if col == 0 or col == 2:
					print(row, col)
			elif col == 2 or col == 4:
				print(row, col)
		else:
			print(row, col)


n = int(input())
t = [x for x in range(0, n * 2 + 1)]
print(7 + (n - 1) * 3)
print(0, 0)
print(1, 0)
c = 1
for i in range(n):
	for v in t[i:i + 3]:
		print(v, c)
	c += 1
print(n, n + 1)
print(n + 1, n + 1)


import atexit
import io
import sys
import math
from collections import defaultdict, Counter
n = int(input())
print(4 + 3 * n)
print(0, 0)
print(0, 1)
print(1, 0)
print(1, 1)
for i in range(n):
	print(i + 1, i + 2)
	print(i + 2, i + 1)
	print(i + 2, i + 2)


def add(s):
	ans.append((s[0] + 1, s[1] + 1))
	ans.append((s[0] + 2, s[1]))
	ans.append((s[0] + 3, s[1]))
	ans.append((s[0] + 2, s[1] + 1))
	ans.append((s[0] + 2, s[1] + 2))
	ans.append((s[0] + 3, s[1] + 1))
	ans.append((s[0] + 3, s[1] + 2))
	ans.append((s[0] + 4, s[1] + 1))
	return [s[0] + 4, s[1]]

def addone(s):
	ans.append((s[0] + 1, s[1]))
	ans.append((s[0] + 1, s[1] + 1))
	ans.append((s[0] + 1, s[1] + 2))
	ans.append((s[0] + 2, s[1]))
	ans.append((s[0] + 2, s[1] + 1))
	ans.append((s[0] + 2, s[1] + 2))
	return [s[0] + 3, s[1] + 1]

def joinends(s):
	ans.append((0, 1))
	ans.append((0, 2))
	ans.append((0, 3))
	ans.append((0, 4))
	for i in range(1, s[0] + 2):
		ans.append((i, 4))
	ans.append((s[0] + 1, 3))
	ans.append((s[0] + 1, 2))
	ans.append((s[0] + 1, 1))
n = int(input())
if n == 1:
	print(7)
	print(0, 0)
	print(0, 1)
	print(1, 0)
	print(1, 1)
	print(1, 2)
	print(2, 1)
	print(2, 2)
	exit()
ans = []
s = [0, 0]
for i in range(n // 2):
	s = add(s)
s[1] += 1
joinends(s)
if n % 2:
	ans.append((s[0] + 1, 5))
	ans.append((s[0] + 2, 4))
	ans.append((s[0] + 2, 5))
print(len(ans))
for i in ans:
	print(i[0], i[1])


x = y = 0
n = int(input())
z = []
for i in range(n + 1):
	z += [[x, y], [x - 1, y], [x, y - 1]]
	x -= 1
	y -= 1
z += [[x, y]]
print(len(z))
for i in z:
	print(*i)


i = int(input())
if i == 0:
	print(0)
else:
	ans = [(1, 0), (0, 1), (1, 1), (2, 1), (1, 2), (0, 0), (2, 2)]
	for j in range(1, i):
		ans.append((j + 1, j + 2))
		ans.append((j + 2, j + 1))
		ans.append((j + 2, j + 2))
	print(len(ans))
	for k in ans:
		print(*k)


import sys
import math
from bisect import bisect_right as br

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

def str_arr():
	return list(map(str, sys.stdin.readline().split()))

def input():
	return sys.stdin.readline().strip()
mod = 1000000007

def recr(x, y, n):
	if n == 0:
		return
	print(x + 1, y)
	print(x, y + 1)
	print(x + 1, y + 1)
	recr(x + 1, y + 1, n - 1)
n = int(input())
ans = 7
if n == 1:
	print(ans)
else:
	print(ans + (n - 1) * 3)
print(0, 0)
print(0, 1)
print(1, 0)
print(1, 1)
x = y = 1
recr(x, y, n)


import sys
cont = sys.stdin.readlines()
cont = [i.strip('\n').split() for i in cont]
n = int(cont.pop(0)[0])
if n % 2:
	level = n // 2 + 1
	print(6 * level + 5)
	for i in range(level):
		print(i + 2, i + 1)
	for i in range(level + 1):
		print(i + 1, i + 1)
		print(i + 2, i)
	for i in range(level):
		print(i + 3, i)
	for i in range(level + 2):
		print(0, i + 1)
		if (i, level + 2) != (0, level + 2):
			print(i, level + 2)
else:
	level = n // 2
	print(6 * level + 14)
	for i in range(level + 1):
		print(1 + i, i + 1)
		print(1 + i + 1, i + 1)
		print(1 + i + 1, i)
		print(1 + i + 2, i)
	for i in range(level + 3):
		print(0, i + 1)
	for i in range(1, level + 5):
		print(i, level + 3)
	for i in range(3):
		print(level + 4, level + i)


n = int(input())
cells = [[0, 0], [1, 0]]
for start in range(n):
	for x in range(start, start + 3):
		cells.append([x, start + 1])
cells.extend([[n, n + 1], [n + 1, n + 1]])
print(len(cells))
for cell in cells:
	print(*cell)


n = int(input())
k = (n - 2) * 2 + 8 + n
print(k)
x = 0
y = 0
i = 0
if n == 1:
	pass
while i < k:
	print(x, y)
	i += 1
	if i == k:
		break
	print(x + 1, y)
	i += 1
	if i == k:
		break
	print(x, y + 1)
	i += 1
	if i == k:
		break
	x += 1
	y += 1


import sys
input = sys.stdin.readline
n = int(input())
pos = set()
for i in range(n):
	(tx, ty) = (1 + i, 1 + i)
	pos.add((tx, ty))
	for (dx, dy) in [(1, 0), (-1, 0), (0, 1), (0, -1), (1, 1), (-1, -1)]:
		pos.add((tx + dx, ty + dy))
ans = list(pos)
print(len(ans))
for (x, y) in ans:
	print(x, y)


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())
	print((n + 1) * 3 + 1)
	j = n
	i = 1
	print(i - 1, j + 1)
	while j >= 0:
		print(i, j)
		print(i - 1, j)
		print(i, j + 1)
		i += 1
		j -= 1
main()


n = int(input())
if n == 1:
	print(7)
elif n == 2:
	print(10)
else:
	x = 10
	y = n - 2
	x = x + y * 3
	print(x)
for i in range(n + 2):
	if i == 0:
		print(0, 0)
		print(0, 1)
	elif i == n + 1:
		print(i, i - 1)
		print(i, i)
	else:
		print(i, i - 1)
		print(i, i)
		print(i, i + 1)


from sys import stdin
input = lambda : stdin.readline().strip()
char = [chr(i) for i in range(97, 123)]
CHAR = [chr(i) for i in range(65, 91)]
mp = lambda : list(map(int, input().split()))
INT = lambda : int(input())
rn = lambda : range(INT())
from math import ceil, sqrt, factorial, gcd
n = INT()
l = []
for i in range(n + 1):
	l.append((i, i))
	l.append((i, i + 1))
	l.append((i + 1, i))
l.append((n + 1, n + 1))
print(len(l))
for j in l:
	print(*j)


import sys, io, os
BUFSIZE = 8192

class FastIO(io.IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = io.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(io.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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
N = int(input())
print(N * 3 + 4)
print(-1, -1)
for i in range(N + 1):
	print(i, i)
	print(i, i - 1)
	print(i - 1, i)


import math
t = int(input())
t = t + 1
pos = [[1, 0], [2, 0], [0, 1], [0, 2], [2, 1], [1, 2]]
print(2 + 6 * t + t - 1)
for i in range(t):
	print(2 * i, 2 * i)
	for j in pos:
		print(2 * i + j[0], 2 * i + j[1])
print(2 * t, 2 * t)


import sys
import math
from sys import stdin, stdout

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

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

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

def main():
	k = int(input())
	z = k // 2
	if k % 2 == 1:
		a = 0
		print(3 * k + 4)
		print(0, 0)
		print(0, 1)
		for i in range(k):
			for j in range(3):
				print(i + 1, i + j)
		print(k + 1, k)
		print(k + 1, k + 1)
	elif z == 2:
		ans = 2 * z + 2 * (z + 2)
		print(ans)
		a = 0
		for i in range(z):
			print(a, i + 1)
		a = 1
		for i in range(z + 2):
			for j in range(2):
				print(a + j, i)
		a = 3
		for i in range(z):
			print(a, i + 1)
	else:
		a = 0
		print(3 * k + 4)
		print(0, 0)
		print(0, 1)
		for i in range(k):
			for j in range(3):
				print(i + 1, i + j)
		print(k + 1, k)
		print(k + 1, k + 1)
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			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')
main()


import os
import sys
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')
from math import factorial
from collections import Counter, defaultdict, deque
from heapq import heapify, heappop, heappush

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

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

def N():
	return int(input())

def comb(n, m):
	return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0

def perm(n, m):
	return factorial(n) // factorial(n - m) if n >= m else 0

def mdis(x1, y1, x2, y2):
	return abs(x1 - x2) + abs(y1 - y2)
mod = 998244353
INF = float('inf')

def main():
	n = N()
	base = [[0, 0], [1, 0]]
	y = 1
	for i in range(n):
		base.extend([[i, y], [i + 1, y], [i + 2, y]])
		y += 1
	base.extend([[n, y], [n + 1, y]])
	print(len(base))
	for i in base:
		print(*i)
main()


n = int(input())
dots = 7 + 3 * (n - 1)
print(dots)
for i in range(0, n + 2):
	init = n - i
	fin = init + 3
	init = init if init > 0 else 0
	fin = fin if fin <= n + 2 else n + 2
	for j in range(init, fin):
		print('{} {}'.format(i, j))


n = int(input())
print(n * 3 + 4)
print(0, 0)
print(0, 1)
(p, q) = (0, 0)
for i in range(1, n + 1):
	for j in range(i - 1, i + 2):
		print(i, j)
		(p, q) = (i, j)
print(p + 1, q - 1)
print(p + 1, q)


def input1():
	return int(input())

def input2():
	return [int(x) for x in input().split()]

def input3():
	return list(map(int, input().split()))
n = input1()
l = []
for i in range(n + 1):
	l.append((i, i))
	l.append((i, i + 1))
	l.append((i + 1, i))
l.append((n + 1, n + 1))
print(len(l))
for i in l:
	print(i[0], i[1])


import sys
input = sys.stdin.readline

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

def instr():
	return str(input())

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

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

def invr():
	return map(int, input().split())
from collections import Counter

def main():
	n = inp()
	j = 0
	print(3 * n + 4)
	print(0, 0)
	print(0, 1)
	for i in range(n):
		print(i + 1, j)
		print(i + 1, j + 1)
		print(i + 1, j + 2)
		j += 1
	print(n + 1, j)
	print(n + 1, j + 1)
main()


import math
n = int(input())
(x, y) = (0, 0)
if n == 1:
	print(7)
	print(1, 0)
	print(1, 1)
	print(1, 2)
	print(0, 1)
	print(2, 1)
	print(2, 2)
	print(0, 0)
else:
	print(3 * (n - 1) + 7)
	print(1, 0)
	print(1, 1)
	print(1, 2)
	print(0, 1)
	print(2, 1)
	print(0, 2)
	print(2, 0)
	x = 2
	y = 0
	for i in range(n - 1):
		print(x + 1, y)
		print(x, y - 1)
		print(x + 1, y - 1)
		x += 1
		y -= 1


n = int(input())
points = []
boxheight = 3
boxwidth = n // 2 * 3 + 2
for i in range(boxheight + 1):
	points.append((0, i))
	points.append((boxwidth, i))
for i in range(1, boxwidth):
	points.append((i, 0))
	points.append((i, boxheight))
for j in range(n // 2):
	i = 2 + 3 * j
	points.append((i, 1))
	points.append((i + 1, 1))
	points.append((i, -1))
	points.append((i + 1, -1))
if n % 2 == 1:
	points.append((boxwidth + 1, boxheight + 1))
	points.append((boxwidth, boxheight + 1))
	points.append((boxwidth + 1, boxheight))
print(len(points))
for p in points:
	print(*p)


n = int(input())
print(7 + 3 * (n - 1))
t = 7 + 3 * (n - 1)
for x in range(n + 2):
	if x == 0:
		for y in range(n + 1, n - 1, -1):
			print(x, end=' ')
			print(y)
	elif x == n + 1:
		for y in range(1, -1, -1):
			print(x, end=' ')
			print(y)
	else:
		for y in range(n + 2 - x, n - x - 1, -1):
			print(x, end=' ')
			print(y)


n = int(input())
points = [[0, 0]]
for i in range(1, n + 2):
	points.append([i - 1, i])
	points.append([i, i])
	points.append([i, i - 1])
k = len(points)
print(k)
for i in range(k):
	print('{} {}'.format(points[i][0], points[i][1]))


import sys
input = lambda : sys.stdin.readline().strip('\r\n')
n = int(input())
ans = [(0, 0), (0, 1), (1, 0), (1, 1)]
(prevx, prevy) = (1, 1)
while n > 0:
	ans.append((prevx + 1, prevy))
	ans.append((prevx, prevy + 1))
	ans.append((prevx + 1, prevy + 1))
	prevy += 1
	prevx += 1
	n -= 1
print(len(ans))
for i in ans:
	print(*i)


n = int(input())
res = []
for i in range(n):
	res.append((i + 1, i + 1))
for i in range(n + 1):
	res.append((i, i + 1))
for i in range(n + 1):
	res.append((i + 1, i))
res.append((0, 0))
res.append((n + 1, n + 1))
print(len(res))
for i in res:
	print(*i)


n = int(input())
ans = [(0, 0), (0, 1), (1, 1), (1, 0)]
for i in range(n):
	ans.extend([(i + 1, i + 2), (i + 2, i + 2), (i + 2, i + 1)])
print(n * 3 + 4)
print('\n'.join([str(a[0]) + ' ' + str(a[1]) for a in ans]))


from sys import stdin
input = stdin.readline
N = int(input())
print(4 + 3 * N)
print('-1 -1\n-1 0\n0 0\n0 -1')
for i in range(1, N + 1):
	print(i, i)
	print(i - 1, i)
	print(i, i - 1)


def create(i, j, n, m):
	fig = []
	for x in range(i, i + m):
		for y in range(j, j + n):
			fig.append([x, y])
	return fig

def ring(i, j, n, m):
	fig = []
	for x in range(i, i + m):
		fig.append([x, j])
		fig.append([x, j + (n - 1)])
	for y in range(j + 1, j + n - 1):
		fig.append([i, y])
		fig.append([i + (m - 1), y])
	return fig
n = int(input())
ans = []
ans += ring(0, 0, 4, 5000)
(x, y) = (1, 3)
while n > 1:
	x += 4
	ans += [[x + 1, y + 1], [x + 2, y + 1], [x + 1, y - 1], [x + 2, y - 1]]
	n -= 2
if n == 1:
	ans += [[4999, 4], [5000, 3], [5000, 4]]
print(len(ans))
[print(*i) for i in ans]


a = int(input())
ini = [(0, 0), (0, 1), (0, 2), (1, 0), (1, 2), (2, 0), (2, 1), (2, 2)]
odd = [(0, 1), (0, 2), (1, 0), (1, 2), (2, 0), (2, 1), (2, 2)]
eve = [(0, 0), (0, 1), (1, 0), (1, 2), (2, 0), (2, 1), (2, 2)]
print(8 + 7 * a)
for i in ini:
	print(i[0], i[1])
x = 0
while x < a:
	x += 1
	if x % 2 == 1:
		for i in odd:
			print(i[0] + x * 2, i[1] + 2)
	else:
		for i in eve:
			print(i[0] + x * 2, i[1])


def main():
	n = int(input())
	l = []
	for i in range(1, n + 1):
		l.append((i, i))
		l.append((i - 1, i))
		l.append((i, i - 1))
		l.append((i + 1, i))
		l.append((i, i + 1))
	l.append((0, 0))
	l.append((n + 1, n + 1))
	l = list(set(l))
	print(len(l))
	for i in l:
		print(i[0], i[1])
main()


n = int(input())
k = 7
cells = []
center = [0, 0]
cells.extend([[0, 0], [1, 0], [-1, 0], [0, 1], [0, -1], [-1, -1], [1, 1]])
while n > 1:
	n -= 1
	center[0] += 1
	center[1] += 1
	cells.append([center[0], center[0] + 1])
	cells.append([center[0] + 1, center[0]])
	cells.append([center[0] + 1, center[0] + 1])
	k += 3
print(k)
for i in range(k):
	print(str(cells[i][0]) + ' ' + str(cells[i][1]))


import sys, os
from io import BytesIO, IOBase
import collections, itertools, bisect, heapq, math, string
from decimal import *
BUFSIZE = 8192
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 main():
	n = int(input())
	print(4 + 3 * n)
	print(0, 0)
	for i in range(1, n + 2):
		print(i, i)
		print(i - 1, i)
		print(i, i - 1)
main()


n = int(input())
print(15 + (n - 1) * 7)
print(1, 1)
print(2, 1)
print(1, 2)
print(3, 1)
print(1, 3)
print(2, 3)
print(3, 2)
print(3, 3)
print(4, 3)
print(3, 4)
print(5, 3)
print(3, 5)
print(4, 5)
print(5, 4)
print(5, 5)
for i in range(n - 1):
	w = i * 2 + 7
	print(w - 2, w - 1)
	print(w - 2, w)
	print(w - 1, w - 2)
	print(w, w - 2)
	print(w - 1, w)
	print(w, w - 1)
	print(w, w)


n = int(input())
i = 2
j = 2
ans = {}
ans[0, 0] = 1
ans[1, 0] = 1
ans[2, 0] = 1
ans[0, 1] = 1
ans[0, 2] = 1
c = 0
while c < n:
	ans[i, j] = 1
	ans[i - 1, j] = 1
	ans[i, j - 1] = 1
	ans[i + 1, j] = 1
	ans[i, j + 1] = 1
	i += 1
	j += 1
	c += 1
ans[i + 1, j - 1] = 1
ans[i + 1, j] = 1
ans[i + 1, j + 1] = 1
ans[i - 1, j + 1] = 1
ans[i, j + 1] = 1
print(len(ans))
for i in ans:
	print(*i)


n = int(input())
ans = [[1, 0], [0, 1], [0, 0], [1, 1]]
i = 1
while n:
	n -= 1
	ans += [[i, i + 1], [i + 1, i], [i + 1, i + 1]]
	i += 1
print(len(ans))
for i in ans:
	print(*i)


from sys import stdin, setrecursionlimit, stdout
from collections import deque
from math import sqrt, floor, ceil, log, log2, log10, pi, gcd, sin, cos, asin

def ii():
	return int(stdin.readline())

def fi():
	return float(stdin.readline())

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

def fmi():
	return map(float, stdin.readline().split())

def li():
	return list(mi())

def si():
	return stdin.readline().rstrip()

def lsi():
	return list(si())
res = ['Yes', 'No']
test_case = 1
while test_case:
	test_case -= 1
	n = ii()
	a = [[0, 0], [1, 0]]
	for i in range(1, n + 1):
		a.append([i - 1, i])
		a.append([i, i])
		a.append([i + 1, i])
	a.append([n, n + 1])
	a.append([n + 1, n + 1])
	print(len(a))
	for i in a:
		print(*i)


from math import *
n = int(input())
k = 7 + 3 * (n - 1)
print(k)
print(0, 0)
a = 1
b = 1
for i in range(n + 1):
	print(a, b)
	print(a - 1, b)
	print(a, b - 1)
	a = a + 1
	b = b + 1


def main():
	n = int(input())
	print(4 + 3 * n)
	for i in range(n + 1):
		if i == 0:
			print(i, i)
		print(i, i + 1)
		print(i + 1, i)
		print(i + 1, i + 1)
main()


import sys
from copy import copy
import math
from operator import mul
from functools import reduce
input = sys.stdin.readline
n = int(input())
print(7 + 3 * (n - 1))
print('0 0')
print('0 1')
print('1 0')
print('1 1')
print('1 2')
print('2 1')
print('2 2')
for i in range(n - 1):
	print(i + 2, i + 3)
	print(i + 3, i + 2)
	print(i + 3, i + 3)


import math
import sys
input = sys.stdin.readline
n = int(input())
k = 4 + 3 * n
print(k)
i = 0
while k > 3:
	print(i, i)
	print(i, i + 1)
	print(i + 1, i)
	k -= 3
	i += 1
print(i, i)


from sys import stdin
n = int(input())
print(3 * (n + 1) + 1)
print(0, 0)
for i in range(1, n + 2):
	print(i - 1, i)
	print(i, i)
	print(i, i - 1)


n = int(input())
lfi = []
for i in range(n + 2):
	lfi.append((i, i))
for i in range(n + 1):
	lfi.append((i, i + 1))
for i in range(n + 1):
	lfi.append((i + 1, i))
print(len(lfi))
for i in lfi:
	print(i[0] + 1, i[1] + 1)


n = int(input())
a = [['.'] * (2 * n + 3) for i in range(5)]
for i in range(2 * n + 3):
	a[2][i] = 'A'
for i in range(n):
	a[1][i * 2 + 2] = 'B'
	a[3][i * 2 + 2] = 'C'
a[0][0] = 'D'
a[0][1] = 'E'
a[1][0] = 'F'
a[0][2] = 'Z'
for i in range(n):
	if i % 2 == 0:
		a[4][i * 2 + 2] = 'G'
		a[4][i * 2 + 3] = 'H'
		a[4][i * 2 + 4] = 'I'
	else:
		a[0][i * 2 + 2] = 'J'
		a[0][i * 2 + 3] = 'K'
		a[0][i * 2 + 4] = 'L'
if n % 2 == 0:
	a[0][2 * n] = 'M'
	a[0][2 * n + 1] = 'N'
	a[0][2 * n + 2] = 'O'
	a[1][2 * n + 2] = 'P'
else:
	a[4][2 * n] = 'Q'
	a[4][2 * n + 1] = 'R'
	a[4][2 * n + 2] = 'S'
	a[3][2 * n + 2] = 'T'
cnt = 0
for i in range(len(a)):
	for j in range(len(a[i])):
		if a[i][j] != '.':
			cnt += 1
print(cnt)
for i in range(len(a)):
	for j in range(len(a[i])):
		if a[i][j] != '.':
			print(i, j)


__MULTITEST = 0
from math import log
from math import ceil

def solve():
	n = int(input())
	SET = [[0, 0]]
	for i in range(0, n + 1):
		x = SET[-1][0]
		y = SET[-1][1]
		SET.append([x + 1, y])
		SET.append([x, y + 1])
		SET.append([x + 1, y + 1])
	print(len(SET))
	for a in SET:
		print(*a, sep=' ')
t = int(input()) if __MULTITEST else 1
for tt in range(t):
	solve()


n = int(input())
m = []
for i in range(n + 4):
	m.append([0] * (n + 4))
m[1][1] = 1
for i in range(2, n + 3):
	m[i][i] = 1
	m[i - 1][i] = 1
	m[i][i - 1] = 1
ans = []
for i in range(n + 4):
	for j in range(n + 4):
		if m[i][j] == 1:
			ans.append([i, j])
print(len(ans))
for i in range(len(ans)):
	print(ans[i][0], ans[i][1])


n = int(input())
arr = []
arr.append([0, 1])

def makefive(n):
	for i in range(0, n):
		p = 4 * i
		arr.append([p, 2])
		arr.append([p + 1, 2])
		arr.append([p + 2, 2])
		arr.append([p + 1, 3])
		arr.append([p + 1, 1])

def makejoin(n):
	for i in range(0, n - 1):
		p = 4 * i
		arr.append([p + 3, 2])
		for j in range(0, 5):
			if i % 2:
				arr.append([p + 1 + j, 0])
			else:
				arr.append([p + 1 + j, 4])
makefive(n)
if n == 1:
	arr.append([2, 3])
else:
	makejoin(n)
	x = 4 * (n - 1)
	if n % 2:
		arr.append([x + 2, 3])
	else:
		arr.append([x + 2, 1])
print(len(arr))
for m in arr:
	print(*m)


import sys
import math
from collections import *

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

def get_list():
	return list(get_ints())

def printspx(*args):
	return print(*args, end='')

def printsp(*args):
	return print(*args, end=' ')
UGLYMOD = int(1000000000.0 + 7)
SEXYMOD = 998244353
MAXN = int(100000.0)
n = int(input())
print(7 * n + 8)
flag = False
matr = [[1, 1, 1, 0, 0], [1, 0, 1, 0, 0], [1, 1, 1, 1, 1], [0, 0, 1, 0, 1], [0, 0, 1, 1, 1]]
for i in range(5):
	for j in range(5):
		if matr[i][j]:
			print(i, j)
fac = 4
n -= 1
while n > 0:
	if n == 1:
		for i in range(3):
			for j in range(3):
				if matr[i][j] and (i != 2 or j != 0):
					print(i, j + fac)
	else:
		for i in range(5):
			for j in range(5):
				if matr[i][j] and (i != 2 or j != 0):
					print(i, j + fac)
	n -= 2
	fac += 4


for t in range(1):
	k = int(input())
	s = k + 2
	out = [[0, s - 1], [0, s - 2], [s - 1, 0], [s - 1, 1]]
	for i in range(1, s - 1):
		j = s - i
		for k in range(j - 2, j + 1):
			out.append([i, k])
	print(len(out))
	for i in out:
		print(i[0], i[1])


import sys
input = sys.stdin.readline
from bisect import *

def linput(tt=int):
	return list(map(tt, input().split()))

def gcd(a: int, b: int):
	while b:
		(a, b) = (b, a % b)
	return a

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

def main():
	N = int(input())
	vR = []
	vRapp = vR.append
	vRapp((0, 0))
	for i in range(1, N + 2):
		vRapp((i, i - 1))
		vRapp((i - 1, i))
		vRapp((i, i))
	print(len(vR))
	for (a, b) in vR:
		print(a, b)
main()


from math import ceil

def problem1():
	(a, b, n) = list(map(int, input().split()))
	if a < b:
		a = a + b
		b = a - b
		a = a - b
	c = 0
	while a <= n:
		a = a + b
		b = a - b
		c += 1
	print(c)

def problem2():
	l = ['c', 'o', 'd', 'e', 'f', 'o', 'r', 'c', 'e', 's']
	k = int(input())
	a = ceil(k ** 0.1)
	s = ''
	if a ** 10 == k:
		for i in l:
			s += i * a
	else:
		c = 0
		a -= 1
		b = a ** 10
		while b < k:
			b = (a + 1) * b // a
			c += 1
		for i in range(c):
			s += l[i] * (a + 1)
		for i in range(c, 10):
			s += l[i] * a
	print(s)

def problem3():
	n = int(input())
	k = 7 + (n - 1) * 3
	print(k)
	a = 1
	b = 1
	print(0, 0)
	print(1, 0)
	print(0, 1)
	print(1, 1)
	for _ in range(n):
		print(a + 1, b)
		print(a, b + 1)
		print(a + 1, b + 1)
		a += 1
		b += 1
problem3()


import sys
sys.setrecursionlimit(10000)
n = int(input())
k = 3 * n + 4
print(k)
print('1 1')
print('1 2')
for i in range(n):
	for y in range(3):
		print(str(i + 2) + ' ' + str(i + y + 1))
print(str(n + 2) + ' ' + str(n + 1))
print(str(n + 2) + ' ' + str(n + 2))


n = int(input())
x = 0
y = 0
coord = []
coord.append((x, y))
coord.append((x + 1, y))
for _ in range(n):
	y += 1
	for i in range(3):
		coord.append((x + i, y))
	x += 1
y += 1
coord.append((x, y))
coord.append((x + 1, y))
print(len(coord))
for (x, y) in coord:
	print(x, y)


from collections import Counter, defaultdict
BS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'

def to_base(s, b):
	res = ''
	while s:
		res += BS[s % b]
		s //= b
	return res[::-1] or '0'
alpha = 'abcdefghijklmnopqrstuvwxyz'
from math import floor, ceil, pi
import re
pattern = '0+'
n = int(input())
print(3 * n + 4)
coordList = [['-'] * 1000 for _ in range(1000)]
for row in range(2 + n):
	if row == 0:
		print(f'0 0')
		print('0 1')
		coordList[0][0] = '*'
		coordList[1][0] = '*'
	elif row == 2 + n - 1:
		print(f'{2 + n - 1} {2 + n - 1}')
		print(f'{2 + n - 1} {2 + n - 2}')
		coordList[2 + n - 1][2 + n - 1] = '*'
		coordList[2 + n - 2][2 + n - 1] = '*'
	else:
		for j in range(-1, 2):
			print(f'{row} {row + j}')
			coordList[row + j][row] = '*'


n = int(input())
ans = [[0, 0], [1, 0], [0, 1], [1, 1], [1, 2], [2, 1], [2, 2]]
for i in range(1, n):
	(curx, cury) = (ans[-1][0], ans[-1][1])
	ans.append([curx, cury + 1])
	ans.append([curx + 1, cury])
	ans.append([curx + 1, cury + 1])
print(len(ans))
for i in ans:
	print(*i)


n = int(input())
print((n + 1) * 3 + 1)
for x in range(n + 2):
	if x == 0:
		print(str(x) + ' ' + str(x))
		print(str(x) + ' ' + str(x + 1))
	elif x == n + 1:
		print(str(x) + ' ' + str(x - 1))
		print(str(x) + ' ' + str(x))
	else:
		print(str(x) + ' ' + str(x - 1))
		print(str(x) + ' ' + str(x))
		print(str(x) + ' ' + str(x + 1))


n = int(input())
k = 1 + (n + 1) * 3
print(k)
print(0, 0)
for i in range(n + 1):
	print(i + 1, i)
	print(i, i + 1)
	print(i + 1, i + 1)


import bisect
import decimal
from decimal import Decimal
import os
from collections import Counter
import bisect
from collections import defaultdict
import math
import random
import heapq
from math import sqrt
import sys
from functools import reduce, cmp_to_key
from collections import deque
import threading
from itertools import combinations
from io import BytesIO, IOBase
from itertools import accumulate
decimal.getcontext().prec = 46

def primeFactors(n):
	prime = set()
	while n % 2 == 0:
		prime.add(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			prime.add(i)
			n = n // i
	if n > 2:
		prime.add(n)
	return list(prime)

def getFactors(n):
	factors = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				factors.append(i)
			else:
				factors.append(i)
				factors.append(n // i)
		i = i + 1
	return factors

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	num = []
	for p in range(2, n + 1):
		if prime[p]:
			num.append(p)
	return num

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

def sort_dict(key_value):
	return sorted(key_value.items(), key=lambda kv: (kv[1], kv[0]))

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

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

def string_list():
	return list(input())

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def binaryToDecimal(n):
	return int(n, 2)

def DFS(n, s, adj):
	visited = [False for i in range(n + 1)]
	stack = []
	stack.append(s)
	while len(stack):
		s = stack[-1]
		stack.pop()
		if not visited[s]:
			visited[s] = True
		for node in adj[s]:
			if not visited[node]:
				stack.append(node)

def solve():
	n = int(input())
	print(3 * n + 4)
	print(0, 0)
	print(1, 0)
	x = 0
	y = -1
	for i in range(n):
		print(x, y)
		print(x + 1, y)
		print(x + 2, y)
		x += 1
		y -= 1
	print(x, y)
	print(x + 1, y)
t = 1
for _ in range(t):
	solve()


from sys import stdin
n = int(stdin.readline())
print(4 + 3 * n)
shift = 1
print(1, 1)
print(1, 2)
for i in range(n):
	print(i + 2, shift)
	print(i + 2, shift + 1)
	print(i + 2, shift + 2)
	shift += 1
print(n + 2, shift)
print(n + 2, shift + 1)


n = int(input())
l = [[0, 0], [0, 1], [1, 0], [1, 1]]
i = 1
j = 1
cnt = 0
pi = pj = 0
while True:
	l1 = []
	l1.append(i)
	l1.append(j + 1)
	l.append(l1)
	l1 = []
	l1.append(i + 1)
	l1.append(j)
	l.append(l1)
	l1 = []
	l1.append(i + 1)
	l1.append(j + 1)
	l.append(l1)
	pi = i
	pj = j
	i = i + 1
	j = j + 1
	cnt = cnt + 1
	if cnt == n:
		break
print(len(l))
for i in l:
	for j in i:
		print(j, end=' ')
	print()


n = int(input())
pos = [[-1, 0], [0, 0], [0, -1]]
print(1 + (n + 1) * 3)
print(0, 0)
for i in range(n + 1):
	for j in range(3):
		for k in range(2):
			pos[j][k] += 1
		print(*pos[j])


n = int(input())
l = []
if n == 1:
	l += [[2, 2]]
	l += [[1, 2]]
	l += [[2, 3]]
	l += [[2, 1]]
	l += [[3, 2]]
	l += [[1, 1]]
	l += [[3, 3]]
elif n % 2 == 0:
	for i in range(2, n // 2 * 3 + 2, 3):
		l += [[i, 2]]
		l += [[i + 1, 2]]
	for i in range(0, n // 2 * 3 + 3):
		l += [[i, 3]]
	l += [[0, 4]]
	l += [[n // 2 * 3 + 2, 4]]
	l += [[0, 5]]
	l += [[n // 2 * 3 + 2, 5]]
	for i in range(2, n // 2 * 3 + 2, 3):
		l += [[i, 4]]
		l += [[i + 1, 4]]
	for i in range(0, n // 2 * 3 + 3):
		l += [[i, 6]]
else:
	for i in range(2, n // 2 * 3 + 2 + 2, 3):
		l += [[i, 2]]
		l += [[i + 1, 2]]
	for i in range(n // 2 * 3 + 2 + 2):
		l += [[i, 3]]
	for i in range(2, n // 2 * 3 + 2 + 2, 3):
		l += [[i, 4]]
		l += [[i + 1, 4]]
	l.pop()
	l += [[0, 4]]
	l += [[0, 5]]
	l += [[n // 2 * 3 + 2, 5]]
	for i in range(n // 2 * 3 + 2 + 1):
		l += [[i, 6]]
print(len(l))
for i in l:
	print(*i)


n = int(input())
lis = []
lis.append([0, 0])
lis.append([1, 0])
lis.append([0, 1])
for i in range(n):
	lis.append([i + 1, i + 1])
	lis.append([i + 2, i + 1])
	lis.append([i + 1, i + 2])
lis.append([n + 1, n + 1])
a = len(lis)
print(a)
for i in range(a):
	print(' '.join((str(x) for x in lis[i])))


import sys
input = sys.stdin.readline
ipnl = lambda n: [int(input()) for _ in range(n)]
inp = lambda : int(input())
ip = lambda : [int(w) for w in input().split()]
from math import sqrt, ceil
k = inp()
sq = []
for i in range(1, k + 1):
	sq.append((i, i))
cells = set(sq)
(dx, dy) = ([1, -1, 0, 0], [0, 0, 1, -1])
for i in sq:
	(u, v) = i
	for j in range(4):
		cells.add((u + dx[j], v + dy[j]))
cells.add((0, 0))
cells.add((k + 1, k + 1))
print(len(cells))
for i in list(cells):
	print(*i)


n = int(input())
pprint = lambda x, y: print('{0} {1}'.format(x, y))
print(3 + n * 3 + 1)
pprint(0, 0)
pprint(0, 1)
pprint(1, 0)
for i in range(1, n + 1):
	pprint(i, i)
	pprint(i + 1, i)
	pprint(i, i + 1)
pprint(n + 1, n + 1)


n = int(input())

def pprint(grid):
	for row in grid:
		print(''.join(map(str, row)))

def gen(n):
	grid = [[0] * (n + 2) for _ in range(n + 2)]
	for i in range(1, n + 1):
		grid[i][i] = 1
		grid[i - 1][i] = 2
		grid[i + 1][i] = 2
		grid[i][i - 1] = 2
		grid[i][i + 1] = 2
	grid[0][0] = 2
	grid[-1][-1] = 2
	return grid
grid = gen(n)
k = n * 5 + 2
points = []
for i in range(len(grid)):
	for j in range(len(grid[0])):
		if grid[i][j]:
			points.append((i, j))
print(len(points))
for (i, j) in points:
	print(i, j)


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
import sys

def main():
	n = int(input())
	k = 4 + 3 * n
	sys.stdout.write(str(k) + '\n')
	Ans = [(0, 0), (1, 0), (0, 1), (1, 1)]
	Block = [[2, 1], [1, 2], [2, 2]]
	for i in range(n):
		for i in range(3):
			block = Block[i][:]
			Ans.append(block)
		for i in range(3):
			Block[i][0] += 1
			Block[i][1] += 1
	for ans in Ans:
		sys.stdout.write(' '.join(map(str, ans)) + '\n')
main()


n = int(input())
(h, w) = (3 + n * 2, 3 + n * 2)
d = [[0, 0], [0, 1], [0, 2], [1, 0], [1, 2], [2, 0], [2, 1], [2, 2]]
ans = []
m = [[False] * w for _ in range(h)]
for y in range(0, h - 1, 2):
	for x in range(0, w - 1, 2):
		if y == x:
			for (dy, dx) in d:
				if not m[y + dy][x + dx]:
					ans.append([x + dx, y + dy])
					m[y + dy][x + dx] = True
print(len(ans))
for (x, y) in ans:
	print(x, y)


from sys import stdin, stdout
import math, queue, heapq
fastinput = stdin.readline
fastout = stdout.write
t = 1
while t:
	t -= 1
	n = int(fastinput())
	print((n + 1) * 8 - n)
	starty = 2
	startx = 0
	x = 'u'
	print(startx, starty)
	for i in range(n + 1):
		if x == 'u':
			print(startx + 1, starty)
			print(startx + 2, starty)
			print(startx, starty + 1)
			print(startx, starty + 2)
			print(startx + 1, starty + 2)
			print(startx + 2, starty + 2)
			print(startx + 2, starty + 1)
			startx += 2
			x = 'd'
		else:
			print(startx + 1, starty)
			print(startx + 2, starty)
			print(startx, starty - 1)
			print(startx, starty - 2)
			print(startx + 1, starty - 2)
			print(startx + 2, starty - 1)
			print(startx + 2, starty - 2)
			startx += 2
			x = 'u'


import sys, math, cmath, time
start_time = time.time()

def solve():
	n = inp()
	q = []
	if n == 1:
		q = q + [[1, 0], [0, 1], [1, 1], [0, 2], [1, 2], [2, 1], [2, 0]]
	else:
		q = q + [[-1, 1], [-1, 2], [-1, 3], [-1, 4]]
		w = 0
		for i in range(n // 2):
			q = q + [[w, 1], [w + 1, 1], [w + 2, 1], [w + 1, 0], [w + 2, 0], [w + 1, 2], [w + 2, 2]]
			w = w + 3
		if n % 2 == 0:
			q + q + [[w, 1], [w + 1, 1], [w + 2, 1], [w + 3, 1], [w + 4, 1]]
			w = w - 1
			qw = [[i - 1, 4] for i in range(1, w + 4)]
			w = w + 2
			q = q + [[w, 1], [w, 2], [w, 3]]
			q = q + qw
			q = q + [[w - 1, 1]]
		else:
			q = q + [[w, 1], [w + 1, 1], [w + 2, 1], [w + 3, 1], [w + 4, 1], [w + 5, 1], [w + 3, -1], [w + 3, 0], [w + 4, -1], [w + 5, -1], [w + 5, 0]]
			q = q + [[w + 3, 2], [w + 3, 3]]
			qw = [[i, 4] for i in range(w + 4)]
			q = q + qw
	print(len(q))
	for i in range(len(q)):
		print(*q[i])

def main():
	global tt
	if not ONLINE_JUDGE:
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	t = 1
	for tt in range(t):
		solve()
	if not ONLINE_JUDGE:
		print('Time Elapsed :', time.time() - start_time, 'seconds')
		sys.stdout.close()

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

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

def insr():
	return input().strip()

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

def counter(a):
	q = [0] * max(a)
	for i in range(len(a)):
		q[a[i] - 1] = (q[a[i] - 1], 1)
	return q

def string_counter(a):
	q = [0] * 26
	for i in range(len(a)):
		q[ord(a[i]) - 97] = (q[ord(a[i]) - 97], 1)
	return q
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
	input = sys.stdin.readline
main()


from sys import stdin, stdout
int_in = lambda : int(stdin.readline())
arr_in = lambda : [int(x) for x in stdin.readline().split()]
mat_in = lambda rows: [arr_in() for _ in range(rows)]
str_in = lambda : stdin.readline().strip()
out = lambda o: stdout.write('{}\n'.format(o))
arr_out = lambda o: out(' '.join(map(str, o)))
bool_out = lambda o: out('YES' if o else 'NO')
tests = lambda : range(1, int_in() + 1)
case_out = lambda i, o: out('Case #{}: {}'.format(i, o))

def solve(n):
	result = []
	result.append([0, 0])
	result.append([0, 1])
	result.append([1, 0])
	result.append([1, 1])
	for i in range(1, n + 1):
		result.append([i, i + 1])
		result.append([i + 1, i])
		result.append([i + 1, i + 1])
	return result
n = int_in()
result = solve(n)
out(len(result))
for row in result:
	arr_out(row)


import sys
input = sys.stdin.readline

def main():
	N = int(input())
	ans = []
	ans.append((0, 0))
	ans.append((0, 1))
	ans.append((0, 2))
	ans.append((1, 0))
	ans.append((2, 0))
	ans.append((2, 1))
	ans.append((2, 2))
	ans.append((1, 2))
	ans.append((2, 3))
	ans.append((2, 4))
	ans.append((3, 4))
	ans.append((4, 4))
	ans.append((4, 3))
	ans.append((4, 2))
	ans.append((3, 2))
	N -= 1
	x = 4
	while N > 0:
		ans.append((x, x + 1))
		ans.append((x, x + 2))
		ans.append((x + 1, x + 2))
		ans.append((x + 2, x + 2))
		ans.append((x + 2, x + 1))
		ans.append((x + 2, x))
		ans.append((x + 1, x))
		N -= 1
		x += 2
	print(len(ans))
	for a in ans:
		print(*a)
main()


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import sqrt, ceil, factorial, inf
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 decimal import Decimal
from fractions import Fraction
mod = 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)]
n = int(data())
par = 1
temp = 2 + n
out(4 + 3 * n)
(i, j) = (0, 0)
for k in range(temp):
	if k == 0 or k == temp - 1:
		out(i, j)
		out(i, j + 1)
		i += 1
	else:
		out(i, j)
		out(i, j + 1)
		out(i, j + 2)
		i += 1
		j += 1


import math

def dtod(a):
	s = ''
	while a != 0:
		s += str(a % 2)
		a = int(a / 2)
	return s[::-1]

def _8_(a):
	return a[0] * a[1] * a[2] * a[3] * a[4] * a[5] * a[6] * a[7] * a[8] * a[9]
q = int(input())
x = 1
y = 0
print(q * 3 + 4)
for i in range(q + 1):
	print(x, y)
	x += 1
	y += 1
x = 0
y = 0
for i in range(q + 2):
	print(x, y)
	x += 1
	y += 1
x = 0
y = 1
for i in range(q + 1):
	print(x, y)
	x += 1
	y += 1


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
ORDA = 97

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

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

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

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

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	newnumber = 0
	while number > 0:
		newnumber += number % base
		number //= base
	return newnumber

def cdiv(n, k):
	return n // k + (n % k != 0)

def ispal(s):
	for i in range(len(s) // 2 + 1):
		if s[i] != s[-i - 1]:
			return False
	return True
n = ii()
print(3 * n + 4)
print(0, 0)
print(0, 1)
for i in range(1, n + 1):
	print(i, i - 1)
	print(i, i)
	print(i, i + 1)
print(n + 1, n)
print(n + 1, n + 1)


n = int(input())
m = n + 2
X = [[1 for i in range(m)] for j in range(m)]
c = 0
for i in range(m):
	for j in range(max(0, n - i)):
		X[i][m - j - 1] = 0
		X[m - j - 1][i] = 0
		c = c + 2
print(m * m - c)
for i in range(m):
	for j in range(m):
		if X[i][j] == 1:
			print(i, j)


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def main():
	n = int(input())
	pairs = []
	pairs.append([0, 0])
	pairs.append([0, 1])
	pairs.append([1, 0])
	pairs.append([1, 1])
	while n:
		x = pairs[-1][0]
		y = pairs[-1][1]
		pairs.append([x + 1, y])
		pairs.append([x, y + 1])
		pairs.append([x + 1, y + 1])
		n -= 1
	size = len(pairs)
	print(size)
	for i in range(size):
		print(pairs[i][0], pairs[i][1])
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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import sys
readline = sys.stdin.readline
N = int(readline())
ans = [(0, 0), (1, 0), (2, 0), (0, 1), (0, 2), (1, 2), (2, 1), (2, 2)]
odd = True
cnt = 2
while N:
	if odd:
		ans.append((cnt + 1, cnt))
		ans.append((cnt, cnt + 1))
		ans.append((cnt + 1, cnt + 1))
		cnt += 1
	else:
		ans.append((cnt + 1, cnt))
		ans.append((cnt, cnt + 1))
		ans.append((cnt, cnt + 2))
		ans.append((cnt + 2, cnt))
		ans.append((cnt + 2, cnt + 1))
		ans.append((cnt + 1, cnt + 2))
		ans.append((cnt + 2, cnt + 2))
		cnt += 2
	N -= 1
	odd = not odd
print(len(ans))
print('\n'.join(('{} {}'.format(*a) for a in ans)))


def solve(n):
	sol = [(0, 0), (1, 0)]
	r = 1
	for _ in range(n):
		sol.append((r - 1, r))
		sol.append((r, r))
		sol.append((r + 1, r))
		r += 1
	sol.append((r - 1, r))
	sol.append((r, r))
	return sol
n = int(input())
coords = solve(n)
print(len(coords))
for (r, c) in coords:
	print(r, c)


import math
from collections import defaultdict, Counter, deque
INF = float('inf')

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def primeFactor(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i ** 2 <= n:
		if n % i == 0:
			return i
		i += 1
	return n

def main():
	n = int(input())
	x = 0
	y = 0
	print(3 * n + 4)
	for i in range(n + 1):
		print(x, y)
		print(x, y + 1)
		print(x + 1, y)
		x += 1
		y += 1
	print(n + 1, n + 1)
t = 1
for _ in range(t):
	main()


def read_list():
	return list(map(int, input().strip().split(' ')))

def print_list(l):
	print(' '.join(map(str, l)))
n = int(input())
k = 3 * n + 4
print(k)
print('0 0')
print('0 1')
for i in range(n):
	print('%d %d' % (i + 1, i))
	print('%d %d' % (i + 1, i + 1))
	print('%d %d' % (i + 1, i + 2))
print('%d %d' % (n + 1, n))
print('%d %d' % (n + 1, n + 1))


import sys
import bisect as b
import math
from collections import defaultdict as dd
input = sys.stdin.readline
mo = 10 ** 9 + 7

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())

def pref(a, n):
	pre = [0] * n
	pre[0] = a[0]
	for i in range(1, n):
		pre[i] = a[i] + pre[i - 1]
	return pre
FibArray = [0, 1]

def fibonacci(n):
	if n < 0:
		print('Incorrect input')
	elif n <= len(FibArray):
		return FibArray[n - 1]
	else:
		temp_fib = fibonacci(n - 1) + fibonacci(n - 2)
		FibArray.append(temp_fib)
		return temp_fib
n = inin()
if n == 4:
	print(12)
	print(1, 0)
	print(2, 0)
	print(0, 1)
	print(1, 1)
	print(2, 1)
	print(3, 1)
	print(0, 2)
	print(1, 2)
	print(2, 2)
	print(3, 2)
	print(1, 3)
	print(2, 3)
else:
	print((n + 1) * 3 + 1)
	c = 0
	for i in range(n + 1):
		print(i, i)
		print(i + 1, i)
		print(i, i + 1)
		c = i
	print(i + 1, i + 1)


N = int(input())
print(8 + 7 * N)
for x in range(0, 3 + 2 * N):
	for y in range(0, 5):
		if x == 0:
			if y > 1:
				print(x, y)
		elif x == 2 + 2 * N:
			if N % 2 == 0:
				if y > 1:
					print(x, y)
			elif y < 3:
				print(x, y)
		elif x % 2 != 0:
			if (x + 1) % 4 == 0:
				if y == 0:
					print(x, y)
				if y == 2:
					print(x, y)
			else:
				if y == 2:
					print(x, y)
				if y == 4:
					print(x, y)
		else:
			print(x, y)


n = int(input())
k = 7 + 3 * (n - 1)
print(k)
print(f'{0} {0}')
print(f'{1} {0}')
a = 0
for i in range(1, n + 1):
	for j in range(3):
		if j == 1:
			x = a
		print(f'{a} {i}')
		a += 1
	a = x
print(f'{x} {i + 1}')
print(f'{x + 1} {i + 1}')


from sys import stdin
input = stdin.readline

def main():
	n = int(input())
	c = 4 + n * 3
	print(c)
	start = 0
	print(start, start)
	print(start, start + 1)
	start += 1
	while start <= n:
		print(start, start - 1)
		print(start, start)
		print(start, start + 1)
		start += 1
	print(start, start - 1)
	print(start, start)
main()


def beauty_pic(n):
	k = 7 + (n - 1) * 3
	print(k)
	r = n + 2
	x = 0
	for i in range(r):
		if i == 0:
			print(1, 0)
			print(2, 0)
		elif i != r - 1:
			print(x, i)
			print(x + 1, i)
			print(x + 2, i)
		else:
			print(x, i)
			print(x + 1, i)
		x = x + 1
n = int(input())
beauty_pic(n)


def pr(j):
	if j == 2:
		print(0, 0)
		print(0, 1)
		print(0, 2)
		print(1, 0)
		print(2, 0)
		print(2, 1)
		print(1, 2)
		print(2, 2)
		print(3, 2)
		print(4, 2)
		print(2, 3)
		print(2, 4)
		print(3, 4)
		print(4, 4)
		print(4, 3)
	else:
		print(j + 1, j)
		print(j + 2, j)
		print(j, j + 1)
		print(j, j + 2)
		print(j + 1, j + 2)
		print(j + 2, j + 1)
		print(j + 2, j + 2)
n = int(input())
if n == 1:
	print(15)
else:
	print(15 + 7 * (n - 1))
for i in range(1, n + 1):
	pr(2 * i)


n = int(input())
cells = [[0, 0], [0, 1], [1, 0], [1, 1], [1, 2], [2, 1], [2, 2]]
l = [2, 2]
for i in range(n - 1):
	cells.extend([[l[0] + 1, l[1]], [l[0], l[1] + 1], [l[0] + 1, l[1] + 1]])
	l = [l[0] + 1, l[1] + 1]
print(len(cells))
for po in cells:
	print(*po)


def solve():
	k = int(input())
	ans = [(0, 0)]
	for i in range(1, k + 2):
		ans.append((i - 1, i))
		ans.append((i, i - 1))
		ans.append((i, i))
	print(len(ans))
	for i in ans:
		print(*i)
for i in range(1):
	solve()


import sys, math
a = int(input())
if a == 1:
	print('7')
	print('0 0')
	print('0 1')
	print('1 0')
	print('1 1')
	print('1 2')
	print('2 1')
	print('2 2')
else:
	print(1 + 5 + (a - 1) * 3 + 1)
	print(0, 0)
	print(1, 0)
	print(0, 1)
	print(1, 1)
	print(2, 1)
	print(1, 2)
	if a > 1:
		print(2, 2)
		for i in range(a - 1):
			print(2 + i, 3 + i)
			print(4 + i - 1, 4 + i - 1)
			print(4 + i - 1, 3 + i - 1)


n = int(input())
print(7 + (n - 1) * 3)
print(0, 1000)
print(0, 1001)
print(1, 1000)
print(2, 1000)
print(1, 1001)
print(1, 999)
print(2, 999)
x = 2
y = 998
for i in range(n - 1):
	print(x, y)
	print(x + 1, y)
	print(x + 1, y + 1)
	x += 1
	y -= 1


import sys
import heapq
import random
import collections
import bisect

def solve(a):
	print(a + 1 + a + 1 + a + 2)
	for i in range(a + 1):
		print('{} {}'.format(i, i + 1))
	for i in range(a + 1):
		print('{} {}'.format(i + 1, i))
	for i in range(a + 2):
		print('{} {}'.format(i, i))

def console(*args):
	print('\x1b[36m', *args, '\x1b[0m', file=sys.stderr)
k = int(input())
res = solve(k)


import time, math, bisect, sys
from sys import stdin, stdout
from collections import deque
from fractions import Fraction
from collections import Counter
from collections import OrderedDict
pi = 3.141592653589793

def II():
	return int(stdin.readline())

def IO():
	return stdin.readline()

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

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

def P(x):
	return stdout.write(str(x))

def PI(x, y):
	return stdout.write(str(x) + ' ' + str(y) + '\n')

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

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

def readTree():
	v = int(input())
	adj = [set() for i in range(v + 1)]
	for i in range(v - 1):
		(u1, u2) = In()
		adj[u1].add(u2)
		adj[u2].add(u1)
	return (adj, v)

def bfs(adj, v):
	visited = [False] * (v + 1)
	q = deque()
	while q:
		pass

def sieve():
	li = [True] * 1000001
	(li[0], li[1]) = (False, False)
	for i in range(2, len(li), 1):
		if li[i] == True:
			for j in range(i * i, len(li), i):
				li[j] = False
	prime = []
	for i in range(1000001):
		if li[i] == True:
			prime.append(i)
	return prime

def setBit(n):
	count = 0
	while n != 0:
		n = n & n - 1
		count += 1
	return count

def solve():
	n = II()
	num = (n + 1) * 4 - n
	print(num)
	print(0, n)
	print(0, n + 1)
	for i in range(1, n + 1):
		for j in range(n - i, n - i + 3):
			print(i, j)
	print(n + 1, 0)
	print(n + 1, 1)
solve()


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from math import sqrt, floor, factorial, gcd, log
from collections import deque, Counter, defaultdict
from itertools import permutations, combinations
from math import gcd
from bisect import bisect
input = lambda : sys.stdin.readline().rstrip('\r\n')
read = lambda : list(map(int, input().strip().split(' ')))

def sqr(n):
	return sqrt(n) ** 2 == float(n)

def chk_nb(i, j):
	tem = [(i + 1, j), (i, j + 1), (i - 1, j), (i, j - 1)]
	c = 0
	for i in tem:
		if i in ans:
			c += 1
	if c % 2:
		return True

def solve():
	n = int(input())
	ans = []
	for i in range(n + 1):
		ans.append([i, i])
		ans.append([i + 1, i])
		ans.append([i, i + 1])
	ans.append([n + 1, n + 1])
	print(len(ans))
	for i in ans:
		print(*i)
solve()


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


import sys
import math
import collections
from sys import stdin, stdout, setrecursionlimit
import bisect as bs
setrecursionlimit(2 ** 20)
M = 10 ** 9 + 7
T = 1
for _ in range(T):
	k = int(stdin.readline())
	print(k + 2 + 2 * (k + 1))
	for i in range(k + 2):
		print(str(i) + ' ' + str(i))
	for i in range(k + 1):
		print(str(i + 1) + ' ' + str(i))
		print(str(i) + ' ' + str(i + 1))


n = int(input())
count = n + 1
print((n + 1) * 3 + 1)
print(0, 0)
x = 0
y = 0
while x <= n:
	print(x + 1, y)
	print(x, y + 1)
	print(x + 1, y + 1)
	x += 1
	y += 1


from sys import stdout, stdin
input = stdin.readline
n = int(input())
a = [[0, 0], [0, 1], [1, 0], [1, 1], [1, 2], [2, 1], [2, 2]]
i = 1
while i < n:
	(x, y) = a[-1]
	a.append([x, y + 1])
	a.append([x + 1, y])
	a.append([x + 1, y + 1])
	i += 1
print(len(a))
for i in a:
	print(*i)


n = int(input())
pairs = []
pairs.append([0, 0])
pairs.append([0, 1])
pairs.append([1, 0])
pairs.append([1, 1])
while n:
	x = pairs[-1][0]
	y = pairs[-1][1]
	pairs.append([x + 1, y])
	pairs.append([x, y + 1])
	pairs.append([x + 1, y + 1])
	n -= 1
size = len(pairs)
print(size)
for i in range(size):
	print(pairs[i][0], pairs[i][1])


n = int(input())
a = [[1, 1]]
for i in range(1, n + 2):
	a += [[i, i + 1], [i + 1, i], [i + 1, i + 1]]
print(len(a))
for i in a:
	print(i[0], i[1])


import sys
lines = sys.stdin.readlines()
n = int(lines[0].strip())
k = 3 * n + 4
print(k)
print('{} {}'.format(0, 0))
print('{} {}'.format(1, 0))
print('{} {}'.format(0, 1))
print('{} {}'.format(1, 1))
for i in range(n):
	print('{} {}'.format(2 + i, 2 + i))
	print('{} {}'.format(1 + i, 2 + i))
	print('{} {}'.format(2 + i, 1 + i))


n = int(input())
s = n + 1
l = dict()
for i in range(n + 2):
	l[i, s] = 1
	s -= 1
s = n
for j in range(n + 1):
	l[j, s] = 1
	s -= 1
s = n + 1
for j in range(1, n + 2):
	l[j, s] = 1
	s -= 1
print(len(l))
for i in range(n + 2):
	for j in range(n + 2):
		if (i, j) in l:
			print(i, j)


import sys
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.readline())

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

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

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def SI():
	return sys.stdin.readline()[:-1]

def main():
	n = II()
	print((n + 2) * 3 - 2)
	for i in range(n + 2):
		(l, r) = (i - 1, i + 2)
		if i == 0:
			l = i
		if i == n + 1:
			r = i + 1
		for j in range(l, r):
			print(i, j)
main()


import os
import sys
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 list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()
INF = 10 ** 18
MOD = 10 ** 9 + 7
n = int(ri())
ans = []
for i in range(1, n + 1):
	ans.append((i, i))
	ans.append((i, i + 1))
	ans.append((i, i - 1))
ans.append((0, 0))
ans.append((0, 1))
ans.append((n + 1, n + 1))
ans.append((n + 1, n))
print(len(ans))
for i in ans:
	print(*i)


from sys import stdin, stdout, setrecursionlimit
from math import floor, gcd, fabs, factorial, fmod, sqrt, inf, log, log2
from random import seed, randint
from datetime import datetime
from collections import defaultdict as dd, deque
from heapq import merge, heapify, heappop, heappush, nsmallest
from bisect import bisect_left as bl, bisect_right as br, bisect
from collections import defaultdict as dd
mod = pow(10, 9) + 7
mod2 = 998244353

def inp():
	return stdin.readline().strip()

def iinp():
	return int(inp())

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

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

def lmp():
	return list(mp())

def mp():
	return map(int, inp().split())

def smp():
	return map(str, inp().split())

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

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

def remadd(x, y):
	return 1 if x % y else 0

def ceil(a, b):
	return (a + b - 1) // b

def def_value():
	return 0

def def_inf():
	return inf
n = iinp()
print(3 * n + 4)
for i in range(0, n + 1):
	print(i, i)
	print(i, i + 1)
	print(i + 1, i)
print(n + 1, n + 1)


from collections import defaultdict as dd
import sys
input = sys.stdin.readline
n = int(input())
cou = 0
res = []
for i in range(n + 1):
	res.append((i, i))
	res.append((i + 1, i))
	res.append((i, i + 1))
res.append((n + 1, n + 1))
print(len(res))
for i in res:
	print(*i)


N = int(input())
ans = [(0, 0), (0, 1), (1, 0), (1, 1)]
for i in range(N):
	ans.append((i + 1, i + 2))
	ans.append((i + 2, i + 1))
	ans.append((i + 2, i + 2))
print(len(ans))
for row in ans:
	print(*row)


n = int(input())
d = 5004
if n % 2 == 0:
	d += 2 * n
if n % 2 == 1:
	d += 2 * n + 1
print(d)
for i in range(2500):
	print(1, i)
print(2, 0)
print(3, 0)
print(2, 2499)
print(3, 2499)
for i in range(2500):
	print(4, i)
c = n
if n % 2 == 1:
	c = n - 1
x = 0
y = 2
for i in range(0, c, 2):
	print(x, y)
	print(x, y + 1)
	y += 3
x = 2
y = 2
for i in range(0, c, 2):
	print(x, y)
	print(x, y + 1)
	y += 3
if n % 2 == 1:
	print(1, 2500)
	print(0, 2499)
	print(0, 2500)


n = int(input())
tot = 4 + 3 * n
print(tot)
print('{} {}'.format(0, 0))
print('{} {}'.format(0, 1))
i = 1
while i <= n:
	print('{} {}'.format(i, i - 1))
	print('{} {}'.format(i, i))
	print('{} {}'.format(i, i + 1))
	i += 1
print('{} {}'.format(i, i - 1))
print('{} {}'.format(i, i))


import sys, io, os, time
from collections import defaultdict
from collections import OrderedDict
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect, math, heapq
alphabet = 'abcdefghijklmnopqrstuvwxyz'
input = sys.stdin.readline
n = int(input())
l = []
l.append([0, 0])
l.append([1, 0])
for i in range(1, n + 1):
	l.append([i - 1, i])
	l.append([i, i])
	l.append([i + 1, i])
l.append([n, n + 1])
l.append([n + 1, n + 1])
print(len(l))
for i in l:
	print(*i)