/* Generate random tests                                             *
 *  Params:                                                          *
 *  - number of rows                                                 *
 *  - number of columns                                              *
 *  - such X that 1/X is a probability that cell is not overwritten. *
 *  - randseed                                                       */

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include "random.h"

using namespace std;

#define forn(i, n) for (int i = 0; i < (int) n; i++)
#define ford(i, n) for (int i = (int) n - 1; i >= 0; i--)

const int NMAX = 100010;
const int MMAX = 101;

int n, m, zn;
char s[NMAX][MMAX];

int main(int argc, char **argv)
{
	n = atoi(argv[1]);
	m = atoi(argv[2]);
	zn = atoi(argv[3]);
	initrand(atoi(argv[4]));

	forn(i, m)
		s[0][i] = R('0', '9');
	for (int i = 1; i < n; ++i)
	{
		int now = m - 1;
		while (now >= 0 && s[i - 1][now] == '9')
			s[i][now--] = '0';
		if (now >= 0)
		{
			s[i][now] = s[i - 1][now] + 1;
			now--;
		}
		while (now >= 0)
		{
			s[i][now] = s[i - 1][now];
			now--;
		}
	}

	forn(i, m)
		forn(j, n)
			if (R(0, zn - 1) != 0) s[j][i] = '.';

	forn(i, n)
	{
		forn(j, m)
			printf("%c", s[i][j]);
		printf("\n");
	}

	return 0;
}
