#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 h, w, x; cin >> h >> w >> x; if (x & 1) { cout << "-1\n"; return 0; } x /= 2; int r = (h + 1) / 2, c = (w + 1) / 2; if (x < r - 1 + c - 1) { cout << "-1\n"; return 0; } vector dir(r, vector(c, -1)); auto solve = [&]() -> void { for (int i = 0; i < r; i += 2) { REP(j, c - 1) dir[i][j] = 3; dir[i][c - 1] = 0; } for (int i = 1; i < r; i += 2) { dir[i][0] = 0; FOR(j, 1, c) dir[i][j] = 1; } int cur = r * c - 1; for (int i = r - 2; i >= 0; i -= 2) { REP(j, c - 1) { if (cur > x) { dir[i][j + 1] = dir[i][j]; dir[i + 1][j + 1] = (j + 2 == c ? 0 : dir[i + 1][j]); dir[i][j] = dir[i + 1][j] = -1; cur -= 2; } } } dir[r - 1][c - 1] = -1; }; if (r % 2 == 1) { if (x > r * c - 1 || (r * c - 1 - x) % 2 == 1) { cout << "-1\n"; return 0; } solve(); } else if (c % 2 == 1) { if (x > r * c - 1 || (r * c - 1 - x) % 2 == 1) { cout << "-1\n"; return 0; } swap(r, c); dir = vector(r, vector(c, -1)); solve(); swap(r, c); vector nx(r, vector(c, -1)); REP(i, r) REP(j, c) nx[i][j] = 3 - dir[j][i]; dir.swap(nx); } else { if (x > r * c - 2 || (r * c - 2 - x) % 2 == 1) { cout << "-1\n"; return 0; } for (int i = 0; i < r - 2; i += 2) { REP(j, c - 1) dir[i][j] = 3; dir[i][c - 1] = 0; } for (int i = 1; i < r - 2; i += 2) { dir[i][0] = 0; FOR(j, 1, c) dir[i][j] = 1; } dir[r - 2][0] = 3; for (int j = 1; j < c; j += 2) { dir[r - 2][j] = 0; dir[r - 1][j] = 3; } for (int j = 2; j < c; j += 2) { dir[r - 2][j] = 3; dir[r - 1][j] = 2; } int cur = r * c - 2; for (int j = 2; j < c; j += 2) { if (cur > x) { dir[r - 2][j - 1] = dir[r - 1][j - 1]; dir[r - 1][j - 1] = dir[r - 1][j] = -1; cur -= 2; } } for (int i = r - 3; i >= 0; i -= 2) { REP(j, c - 1) { if (cur > x) { dir[i][j + 1] = dir[i][j]; dir[i + 1][j + 1] = (j + 2 == c ? 0 : dir[i + 1][j]); dir[i][j] = dir[i + 1][j] = -1; cur -= 2; } } } dir[r - 1][c - 1] = -1; } // REP(i, r) REP(j, c) cout << dir[i][j] << " \n"[j + 1 == c]; vector ans(h, string(w, '#')); for (int i = 0; i < h; i += 2) for (int j = 0; j < w; j += 2) ans[i][j] = '.'; REP(i, r) REP(j, c) { if (dir[i][j] == 0) { ans[i * 2 + 1][j * 2] = '.'; } else if (dir[i][j] == 1) { ans[i * 2][j * 2 - 1] = '.'; } else if (dir[i][j] == 2) { ans[i * 2 - 1][j * 2] = '.'; } else if (dir[i][j] == 3) { ans[i * 2][j * 2 + 1] = '.'; } } REP(i, h) cout << ans[i] << '\n'; return 0; }