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