#include<bits/stdc++.h>
template<typename _Tp>void read(_Tp &x){
	char ch=getchar();bool f=0;while(!isdigit(ch))f|=ch=='-',ch=getchar();
	x=ch&15,ch=getchar();while(isdigit(ch))x=x*10+(ch&15),ch=getchar();
	if(f)x=-x;
}
template<typename _Tp,typename ...Args>void read(_Tp &x,Args &...args){read(x),read(args...);}
std::mt19937 rnd(std::chrono::steady_clock::now().time_since_epoch().count());
int main(){
	int T=2;printf("%d\n",T);
	while(T--){
		int n=rnd()%8+1,rt=rnd()%n+1;printf("%d %d\n",n,rt);
		for(int i=1;i<=n;++i)printf("%d%c",rnd()%100+1," \n"[i==n]);
		std::vector<int> p(n);std::iota(p.begin(), p.end(),1);std::shuffle(p.begin(), p.end(),rnd);
		for(int i=0;i+1<n;++i)printf("%d %d\n",p[i],p[i+1]);
	}
	return 0;
}
