#pragma region template #include #include using namespace std; using namespace atcoder; // clang-format off using ll = long long; using vl = vector; using vvl = vector; using ld = long double; using vld = vector; using vvld = vector; using pll = pair; using vpll = vector; using vvpll = vector; template using V = vector; template using VV = vector>; template using VVV = vector>; using vb = vector; using vs = vector; using mll = map; using msl = map; template using heap = priority_queue; template using min_heap = priority_queue, greater>; constexpr ll inf = 3001001000100100100LL; constexpr int inf_int = 1000000009; #define endl '\n' #define _overload(_1, _2, _3, name, ...) name #define rep(...) _overload(__VA_ARGS__, _rep, _rep2,)(__VA_ARGS__) #define repc(...) _overload(__VA_ARGS__, _repc, _repc2,)(__VA_ARGS__) #define repr(...) _overload(__VA_ARGS__, _repr, _repr2,)(__VA_ARGS__) #define reprc(...) _overload(__VA_ARGS__, _reprc, _reprc2,)(__VA_ARGS__) #define _rep(i,k,n) for(ll i=(k) , i##_xxxx=(n); i < i##_xxxx; ++i) #define _repc(i,k,n) for(ll i=(k) , i##_xxxx=(n); i <=i##_xxxx; ++i) #define _repr(i,k,n) for(ll i=(n)-1, i##_xxxx=(k); i >=i##_xxxx; --i) #define _reprc(i,k,n) for(ll i=(n) , i##_xxxx=(k); i >=i##_xxxx; --i) #define _rep2(i,n) _rep(i,0,n) #define _repc2(i,n) _repc(i,1,n) #define _repr2(i,n) _repr(i,0,n) #define _reprc2(i,n) _reprc(i,1,n) #define rall(o) rbegin(o), rend(o) #define all(o) begin(o), end(o) template ll sz(const C& c) { return static_cast(c.size()); } template bool chmax(T& m, const T& v){ if (m < v){ m = v; return true; } return false; } template bool chmin(T& m, const T& v){ if (v < m){ m = v; return true; } return false; } template T udiv(const T& a, const T& b){ return (a + b - 1) / b; } template T rdiv(const T& a, const T& b){ return (a + b / 2) / b; } template string join(const T& v, const S& sep ){ stringstream ss; bool f = false; for (const auto& e : v){ if (f) ss << sep; f = true; ss << e;} return ss.str(); } template string join(const T& v, const S& sep, const U& ...args){ stringstream ss; bool f = false; for (const auto& c : v){ if (f) ss << sep; f = true; ss << join(c, args...); } return ss.str(); } template ostream& operator<<(ostream& os, const vector& seq){ os << '[' << join(seq, ",") << ']'; return os; } template ostream& operator<<(ostream& os, const vector>& seq){ os << '[' << join(seq, ",\n ") << ']'; return os; } template ostream& operator<<(ostream& os, const deque& seq){ os << '[' << join(seq, ",") << ']'; return os; } template ostream& operator<<(ostream& os, const set& seq){ os << '{' << join(seq, ",") << '}'; return os; } template ostream& operator<<(ostream& os, const unordered_set& seq){ os << '{' << join(seq, ",") << '}'; return os; } template ostream& operator<<(ostream& os, const map& seq){ os << '{'; bool f = false; for (const auto& e : seq){ if (f) os << ','; f = true; os << e.first << ":" << e.second; } os << '}'; return os; } template ostream& operator<<(ostream& os, const pair& pa){ os << '(' << pa.first << ',' << pa.second << ')'; return os; } #if LOCAL #define debug(...) _debug(__VA_ARGS__, __LINE__) #else #define debug(...) #endif void print() { std::cout << '\n'; } template void print(const S& a){ std::cout << a << '\n'; } template void _debug(const S& a){ std::cerr << "(L:" << std::setw(3) << a << ")\n"; } template void print(const S& a, const T&... args){ std::cout << a << ' '; print(args...); } template void _debug(const S& a, const T&... args){ std::cerr << a << ' '; _debug(args...); } struct setup_main { setup_main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); std::cout << fixed << setprecision(15); } } setup_main_; // clang-format on #pragma endregion void ng() { print(-1); exit(0); } void out(vvl v, ll H, ll W) { debug(H, W); debug(v); vs ans(H, string(W, '0')); for (ll ry : {0, 1}) { for (ll rx : {0, 1}) { for (ll x = rx; x < W; x += 3) { for (ll y = ry; y < H; y += 3) { ans[y][x] = v[ry][rx] + '0'; } } } } print(join(ans, '\n')); exit(0); } void solve(ll W, ll H, ll X) { if (H % 3 == 2 and W % 3 == 2) { if (X > 4 * 9) ng(); vl v1(4, 0); rep(i, 4) { v1[i] = min(9LL, X); X -= v1[i]; } if (X > 0) ng(); vvl v = {{v1[0], v1[1]}, {v1[2], v1[3]}}; out(v, H, W); } if (H % 3 == 2 or W % 3 == 2) { if (X > 2 * 9) ng(); vl v1(2, 0); rep(i, 2) { v1[i] = min(9LL, X); X -= v1[i]; } if (X > 0) ng(); vvl v = {{0, 0}, {0, 0}}; if (H % 3 == 2) { ll rx = 1 - W % 3; v[0][rx] = v1[0]; v[1][rx] = v1[1]; out(v, H, W); } else { ll ry = 1 - H % 3; v[ry][0] = v1[0]; v[ry][1] = v1[1]; out(v, H, W); } } { if (X > 9) ng(); ll rx = 1 - H % 3, ry = 1 - W % 3; vvl v = {{0, 0}, {0, 0}}; v[ry][rx] = X; out(v, H, W); } } int main() { ll W, H, X; cin >> W >> H >> X; solve(W, H, X); }