#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;
}
std::mt19937 rnd(std::chrono::steady_clock::now().time_since_epoch().count());
int main(){
	int T=5,id=0;printf("%d %d\n",T,id);
	for(int i=1;i<=T;++i){
		int n=1e3,m=1e3,c=rnd()%2,f=rnd()%2;printf("%d %d %d %d\n",n,m,c,f);
		for(int i=1;i<=n;++i){
			for(int j=1;j<=m;++j)printf("%d",rnd()%1000?0:1);
			printf("\n");
		}
	}
	return 0;
}
