#include<bits/stdc++.h>
#ifdef xay5421
#define D(...) fprintf(stderr,__VA_ARGS__)
#else
#define D(...) ((void)0)
#endif
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define per(i,a,b) for(int i=(a);i>=(b);--i)
#define each(x,v) for(auto&x:v)
#define SZ(x) ((int)(x).size())
#define pb push_back
#define eb emplace_back
using namespace std;
using LL=long long;
template<class T>void rd(T&x){
	int f=0,c;
	while(!isdigit(c=getchar()))f^=!(c^45);
	x=(c&15);
	while(isdigit(c=getchar()))x=x*10+(c&15);
	if(f)x=-x;
}
int brand(){return rand();}
int main(){
	freopen("match.in","w",stdout);
	int n=250000,Q=250000;
	printf("%d %d\n",n,Q);
	rep(i,1,n){
		printf("%d ",brand()%n+1);
	}
	puts("");
	rep(i,1,n){
		printf("%d ",brand()%n+1);
	}
	puts("");
	rep(i,1,Q){
		printf("2 %d\n",n-1);
	}
	return 0;
}
