/*
after dusk passed,
there is a starry sky.
*/
#include <bits/stdc++.h>
#define inf 0x3f3f3f3f
#define m_k make_pair
#define int long long
#define len(a) (int)a.size()
using namespace std;
const int N=110;
int n,m,mp[N][N];
random_device rd;
mt19937_64 rnd(rd());
inline int read()
{
	int f=1,x=0;char c=getchar();
	while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
	while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
	return x*f;
}
inline int ran(int l,int r)
{
	uniform_int_distribution <int> dis(l,r);
	return dis(rnd);
}
signed main()
{
	n=ran(4,6);m=ran(n-1,min(15ll,n*(n-1)/2));
	printf("%lld %lld\n",n,m);
	for (int i=2;i<=n;i++)
	{
		int u=ran(1,i-1);
		mp[i][u]=mp[u][i]=1;
		printf("%lld %lld\n",i,u);
	}
	for (int i=n;i<=m;i++)
	{
		int u=ran(1,n),v=ran(1,n);
		while (u==v||mp[u][v]) u=ran(1,n),v=ran(1,n);
		mp[u][v]=mp[v][u]=1;
		printf("%lld %lld\n",u,v);
	}
}