#include <iostream>
using namespace std;
int main()
{
int m, n, k;
cin >> m >> n >> k;
for (int i = 0; i < m; i++)
{
if (i % (k + 1) == 0)
{
for (int j = 0; j < n; j++)
{
cout << (j % (k + 1) == 0 ? "+" : "-");
}
}
else
{
for (int j = 0; j < n; j++)
{
if (j % (k + 1) == 0)
{
cout << "|";
}
else
{
int a = (j % (k + 1) + i % (k + 1) - 1) % k;
cout << (a == 0 ? k : a);
}
}
}
cout << endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwogCmludCBtYWluKCkgCnsKCWludCBtLCBuLCBrOwoJY2luID4+IG0gPj4gbiA+PiBrOwoJZm9yIChpbnQgaSA9IDA7IGkgPCBtOyBpKyspCgl7CgkJaWYgKGkgJSAoayArIDEpID09IDApCgkJewoJCQlmb3IgKGludCBqID0gMDsgaiA8IG47IGorKykKCQkJewoJCQkJY291dCA8PCAoaiAlIChrICsgMSkgPT0gMCA/ICIrIiA6ICItIik7CgkJCX0KCQl9CgkJZWxzZQoJCXsKCQkJZm9yIChpbnQgaiA9IDA7IGogPCBuOyBqKyspCgkJCXsKCQkJCWlmIChqICUgKGsgKyAxKSA9PSAwKQoJCQkJewoJCQkJCWNvdXQgPDwgInwiOwoJCQkJfQoJCQkJZWxzZQoJCQkJewoJCQkJCWludCBhID0gKGogJSAoayArIDEpICsgaSAlIChrICsgMSkgLSAxKSAlIGs7CgkJCQkJY291dCA8PCAoYSA9PSAwID8gayA6IGEpOwoJCQkJfQoJCQl9CgkJfQoJCWNvdXQgPDwgZW5kbDsKCX0KCXJldHVybiAwOwp9