#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
#define gc getchar
#define pc putchar
int brand(){return(rand()<<16)+(rand()<<1)+(rand()&1);}
int T,n,m,c,f;
int main(){
	freopen("plant.in","w",stdout);
	srand(GetTickCount());
	T=5;
	printf("%d 1\n",T);
	while(T--){
		c=1,f=1;
		n=rand()%1000+1,m=rand()%1000+1;
		n=1000,m=1000;
		printf("%d %d %d %d\n",n,m,c,f);
		for(int i=1;i<=n;i++,pc('\n'))
		for(int j=1;j<=m;j++)pc(48+(rand()&1));
	}
	return 0;
}