#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;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int brand(){return rng()&0X7FFFFFFF;}
int main(){
	freopen("meow.in","w",stdout);
	int T=1;
	printf("%d\n",T);
	while(T--){
		int n=brand()%3+1,m=(brand()%10000+1)*2,K=max(1,n*2-2);
		printf("%d %d %d\n",n,m,K);
		vector<int>v;
		rep(i,1,m/2){
			int x=brand()%K+1;
			v.pb(x);
			v.pb(x);
		}
		shuffle(v.begin(),v.end(),rng);
		rep(i,0,SZ(v)-1){
			printf("%d ",v[i]);
		}
		puts("");
	}
	return 0;
}
