#include<bits/stdc++.h>
#define Pc(x) putchar(x)
#define PB push_back
#define Me(x,y) memset(x,y,sizeof(x))
#define Mc(x,y) memcpy(x,y,sizeof(x))
#define R(x) (rnd()%x+1)
using namespace std;using ll=long long;using ull=unsigned ll;
const int N=2.5e5+5,M=N*4+5,eps=1e-5,INF=1e6,mod=998244353;mt19937 rnd(time(0));
int A[N],x,y;
int main(){
	freopen("match.in","w",stdout);
	int i,n=2.5e5,m=2.5e5;printf("0 %d\n",n);
	for(i=1;i<=n;i++) A[i]=i;shuffle(A+1,A+n+1,rnd);for(i=1;i<=n;i++) printf("%d ",A[i]);Pc('\n');
	for(i=1;i<=n;i++) A[i]=i;shuffle(A+1,A+n+1,rnd);for(i=1;i<=n;i++) printf("%d ",A[i]);Pc('\n');
	printf("%d\n",m);while(m--){
		x=R(n),y=R(n);printf("%d %d\n",min(x,y),max(x,y));
	}
}