#include <bits/stdc++.h>
using namespace std;
int n = 1000, m = 999;
mt19937 rnd(time(NULL));
int tu[20][20];
int main()
{
	freopen("barrack.in", "w", stdout);
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	cout << n << " " << m << "\n";
	for (int i = 2, x; i <= n; ++ i) cout << i - 1 << " " << i << "\n";
	for (int i = 1; i <= m - (n - 1); ++ i)
	{
		int x = rnd() % n + 1, y = rnd() % n + 1;
		while(x == y || tu[x][y])x = rnd() % n + 1, y = rnd() % n + 1;
		cout << x << " " << y << "\n";
	}
}