#include <bits/stdc++.h>
using namespace std;

template <typename T>
inline void read(T &f) {
	f = 0; int fu = 0; char c = getchar();
	while (c < '0' || c > '9') {
		if (c == '-') fu = 1;
		c = getchar();
	}
	while (c >= '0' && c <= '9') {
		f = f * 10 + c - '0';
		c = getchar();
	}
	if (fu) f = -f;
}

#include <Windows.h>

mt19937 rng(GetTickCount());

int T, sub;

int main() {
	freopen("plant.in", "w", stdout);
	T = 5;
	printf("%d 0\n", T);
	while (T--) {
		int n = rng() % 100 + 1, m = rng() % 100 + 1;
		int p = rng() % 100 + 2;
		printf("%d %d 1 1\n", n, m);
		for (int i = 1; i <= n; i++) {
			for (int j = 1; j <= m; j++) {
				int x = rng() % p;
				if (x != 1) x = 0;
				printf("%d", x);
			}
			printf("\n");
		}
	}
	return 0;
}