#include #include #include using namespace std; int main() { int w, h, x; cin >> w >> h >> x; int a[3][3] = {{0, 0, 0},{0, 0, 0},{0, 0, 0}}; int s = 0; for (int i = 0; i < 2; i++) { if (h % 3 == i) continue; for (int j = 0; j < 2; j++) { if (w % 3 == j) continue; a[i][j] = min(9, x-s); s += a[i][j]; } } if (s != x) cout << -1 << endl; else { vector ans(h, vector(w, 0)); for (int i = 0; i < h; i++) for (int j = 0; j < w; j++) ans[i][j] = a[i%3][j%3]; for (int i = 0; i < h; i++) { for (int a : ans[i]) cout << a; cout << endl; } for (int i = 0; i < h; i++) for (int j = 0; j < w; j++) { int sum = 0; for (int x = i-1; x <= i+1; x++) for (int y = j-1; y <= j+1; y++) if (0 <= x && x < h && 0 <= y && y < w) sum += ans[x][y]; cerr << i << ' ' << j << ' ' << sum << endl; assert(sum == x); } } }