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

int main(int argc, char **argv) {
	int n = atoi(argv[1]);	
	std::vector<std::pair<int, int> > edges;
	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j < n; j++) {
			edges.push_back(std::make_pair(i + 1, j + 1));
		}
	}
	
	std::random_shuffle(edges.begin(), edges.end());
	printf("%d %d\n", n, edges.size());
	for (int i = 0; i < edges.size(); i++) {
		printf("%d %d\n", edges[i].first, edges[i].second);
	}
	return 0;
}
