#include <stdio.h>
#include <stdlib.h>
#include <algorithm>

int main(int argc, char **argv) {
	int n = atoi(argv[1]);
	srand(atoi(argv[2]));

	int mix[18];
	for (int i = 0; i < n; i++) {
		mix[i] = i + 1;
	}
	std::random_shuffle(mix, mix + n);

	printf("%d %d\n", n, n);

	for (int i = 0; i < n; i++) {
		printf("%d %d\n", mix[i], mix[(i + 1) % n]);
	}
	return 0;
}