#define _USE_MATH_DEFINES #include using namespace std; #define FOR(i,m,n) for(int i=(m);i<(n);++i) #define REP(i,n) FOR(i,0,n) #define ALL(v) (v).begin(),(v).end() using ll = long long; constexpr int INF = 0x3f3f3f3f; constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL; constexpr double EPS = 1e-8; constexpr int MOD = 1000000007; // constexpr int MOD = 998244353; constexpr int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1}; constexpr int dy8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dx8[] = {0, -1, -1, -1, 0, 1, 1, 1}; template inline bool chmax(T &a, U b) { return a < b ? (a = b, true) : false; } template inline bool chmin(T &a, U b) { return a > b ? (a = b, true) : false; } struct IOSetup { IOSetup() { std::cin.tie(nullptr); std::ios_base::sync_with_stdio(false); std::cout << fixed << setprecision(20); } } iosetup; int main() { int w, h, x; cin >> w >> h >> x; vector m(h, vector(w, 0)); if (x <= 9) { vector r, c; if (h % 3 == 0) { for (int i = 1; i < h; i += 3) r.emplace_back(i); } else if (h % 3 == 1) { r.emplace_back(0); for (int i = 3; i < h; i += 3) r.emplace_back(i); r.emplace_back(h - 1); } else { for (int i = 0; i < h; i += 3) r.emplace_back(i); } if (w % 3 == 0) { for (int j = 1; j < w; j += 3) c.emplace_back(j); } else if (w % 3 == 1) { c.emplace_back(0); for (int j = 3; j < w; j += 3) c.emplace_back(j); c.emplace_back(w - 1); } else { for (int j = 0; j < w; j += 3) c.emplace_back(j); } for (int i : r) for (int j : c) m[i][j] = x; } else if (x <= 18) { if (h % 3 == 2) { for (int j = (w % 3 == 0 ? 1 : 0); j < w; j += 3) for (int i = 0; i + 1 < h; i += 3) { m[i][j] = 9; m[i + 1][j] = x - 9; } } else if (w % 3 == 2) { for (int i = (h % 3 == 0 ? 1 : 0); i < h; i += 3) for (int j = 0; j + 1 < w; j += 3) { m[i][j] = 9; m[i][j + 1] = x - 9; } } else { cout << "-1\n"; return 0; } } else if (x <= 36) { if (h % 3 != 2 || w % 3 != 2) { cout << "-1\n"; return 0; } for (int i = 0; i + 1 < h; i += 3) for (int j = 0; j + 1 < w; j += 3) { m[i][j] = m[i][j + 1] = 9; m[i + 1][j] = min(x - 18, 9); m[i + 1][j + 1] = x - (m[i + 1][j] + 18); } } else { cout << "-1\n"; return 0; } REP(i, h) { REP(j, w) cout << m[i][j]; cout << '\n'; } return 0; }