#include using namespace std; struct iofast_t { iofast_t() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); } } iofast; struct uns_t {} uns; template auto vec(Element init, Head arg, Args ...args) { if constexpr (sizeof...(Args) == 0) return std::vector(arg, init); else return std::vector(arg, vec(init, args...)); } template auto vec(uns_t, Head arg, Args ...args) { return vec(Element(), arg, args...); } int main() { int w, h, x; cin >> w >> h >> x; int n = (w % 3 == 0 ? 1 : w % 3) * (h % 3 == 0 ? 1 : h % 3); if (x < n || n * 9 < x) { cout << -1 << endl; return 0; } if (w % 3 == 0 && h % 3 == 0) { for (int i = 0; i < h; ++i) { for (int j = 0; j < w; ++j) { if (i % 3 != 1 || j % 3 != 1) { cout << 0; continue; } cout << x; } cout << endl; } } if (w % 3 == 1 && h % 3 == 0) { for (int i = 0; i < h; ++i) { for (int j = 0; j < w; ++j) { if (i % 3 != 1 || j % 3 != 0) { cout << 0; continue; } cout << x; } cout << endl; } } if (w % 3 == 2 && h % 3 == 0) { for (int i = 0; i < h; ++i) { for (int j = 0; j < w; ++j) { if (i % 3 != 1 || j % 3 == 2) { cout << 0; continue; } if (j % 3 == 0) { cout << x / 2; continue; } cout << (x + 1) / 2; } cout << endl; } } if (w % 3 == 0 && h % 3 == 1) { for (int i = 0; i < h; ++i) { for (int j = 0; j < w; ++j) { if (i % 3 != 0 || j % 3 != 1) { cout << 0; continue; } cout << x; } cout << endl; } } if (w % 3 == 1 && h % 3 == 1) { for (int i = 0; i < h; ++i) { for (int j = 0; j < w; ++j) { if (i % 3 != 0 || j % 3 != 0) { cout << 0; continue; } cout << x; } cout << endl; } } if (w % 3 == 2 && h % 3 == 1) { for (int i = 0; i < h; ++i) { for (int j = 0; j < w; ++j) { if (i % 3 != 0 || j % 3 == 2) { cout << 0; continue; } if (j % 3 == 0) { cout << x / 2; continue; } cout << (x + 1) / 2; } cout << endl; } } if (w % 3 == 0 && h % 3 == 2) { for (int i = 0; i < h; ++i) { for (int j = 0; j < w; ++j) { if (i % 3 == 2 || j % 3 != 1) { cout << 0; continue; } if (i % 3 == 0) { cout << x / 2; continue; } cout << (x + 1) / 2; } cout << endl; } } if (w % 3 == 1 && h % 3 == 2) { for (int i = 0; i < h; ++i) { for (int j = 0; j < w; ++j) { if (i % 3 == 2 || j % 3 != 0) { cout << 0; continue; } if (i % 3 == 0) { cout << x / 2; continue; } cout << (x + 1) / 2; } cout << endl; } } if (w % 3 == 2 && h % 3 == 2) { for (int i = 0; i < h; ++i) { for (int j = 0; j < w; ++j) { if (i % 3 == 2 || j % 3 == 2) { cout << 0; continue; } if (i % 3 == 0 || j % 3 == 0) { cout << x / 4; continue; } cout << (x - x / 4 * 3); } cout << endl; } } }