1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <cstdio>
#include <cstdlib>
#include <cstdint>
#include <vector>
#include <map>
#include <algorithm>
#include <set>
#include <time.h>
#include <queue>

using namespace std;

int main () {
	int k;
	scanf("%d", &k);
	printf("95\n2 3\n4 5\n6 7\n8 9\n10 11\n12 13\n14 15\n16 17\n18 19\n20 21\n22 23\n24 25\n26 27\n28 29\n30 31\n32 33\n34 35\n36 37\n");
	for (int i = 0; i <= 18; ++i) {
		printf("%d -1\n", ((k % 3) ? (38 + i * 3 + k % 3) : -1));
		k /= 3;
	}
	printf("39 40\n95 -1\n39 95\n");
	for (int i = 0; i < 18; ++i) {
		printf("%d %d\n%d %d\n%d %d\n", 42 + 3 * i, 43 + 3 * i, 38 + 3 * i, -1, 38 + 3 * i, 42 + 3 * i);
	}
	printf("-1 -1\n");
	return 0;
}