#include<bits/stdc++.h>
using namespace std;
mt19937 mt(time(0));
vector<int>vec;
int T=2,n=300,m=1000000,k=2*n-1;
int main(){
	freopen("meow.in","w",stdout);
	printf("%d\n",T);
	while(T--){
		vec.clear();
		printf("%d %d %d\n",n,m,k);
		for(int i=1;i<=m/2;++i){
			int x=mt()%k+1;
			vec.emplace_back(x);
			vec.emplace_back(x);
		}
		shuffle(vec.begin(),vec.end(),mt);
		for(int x:vec)printf("%d ",x);
		putchar('\n');
	}
	return 0;
}
