#include #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; typedef long long ll; vector solve(int H, int W, int X) { int minX = H + W - 2; if (X < minX) return {"-1"}; int A = X - minX; if (A % 4) return {"-1"}; vector ret(H); rep(i, H) { if (i % 2) { rep(j, W - 1) ret[i].push_back('#'); ret[i].push_back('.'); } else { rep(j, W) ret[i].push_back('.'); } } if (H % 4 == 1) { int maxX = (W - 1) * (H + 1) / 2 + H - 1; if (X > maxX) return {"-1"}; int dx = X - minX, p = (W - 1) * 2, q = dx / p, r = dx % p; //cout << "dx=" << dx << " p=" << p << " q=" << q << " r=" << r << "\n"; rep(i, q) { ret[i * 4 + 3][0] = '.'; ret[i * 4 + 3][W - 1] = '#'; } if (q * 4 + 3 < H) { ret[q * 4 + 3][W - 1] = '#'; ret[q * 4 + 3][W - 1 - r / 2] = '.'; } return ret; } if (W % 4 == 1) { vector r = solve(W, H, X); rep(i, H) rep(j, W) ret[i][j] = r[j][i]; return ret; } int maxX = (W - 1) * (H - 1) / 2 + H - 1 + W / 4 * 4; //cout << "maxX=" << maxX << "\n"; if (X > maxX) return {"-1"}; int dx = X - minX, p = (W - 1) * 2, q = dx / p, r = dx % p; //cout << "dx=" << dx << " p=" << p << " q=" << q << " r=" << r << "\n"; if (q > H / 4) { r += (q - H / 4) * p; q = H / 4; } rep(i, q) { ret[i * 4 + 3][0] = '.'; ret[i * 4 + 3][W - 1] = '#'; } if (r > 0 && q * 4 + 3 < H && W - 1 - r / 2 >= 0) { ret[q * 4 + 3][W - 1] = '#'; ret[q * 4 + 3][W - 1 - r / 2] = '.'; return ret; } rep(i, r / 4) { ret[H - 2][i * 4] = '.'; ret[H - 3][i * 4 + 1] = '#'; ret[H - 2][i * 4 + 2] = '.'; ret[H - 1][i * 4 + 3] = '#'; } return ret; } int main() { int H, W, X; cin >> H >> W >> X; vector ans = solve(H, W, X); rep(i, ans.size()) cout << ans[i] << "\n"; }