#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; char ans[1010][1010]; int main() { int h, w, x; cin >> h >> w >> x; bool bo = true; if (h % 4 == 3 && w % 4 == 3 && h != 3 && w != 3) { int now = h + w - 2; for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { if (j == 0 || i % 2 == 0) { ans[i][j] = '.'; } else { ans[i][j] = '#'; } } } for (int i = 0; i < h - 3; i += 4) { for (int j = 1; j < w; j += 2) { if (now < x) { ans[i + 1][j - 1] = '#'; ans[i][j] = '.'; ans[i][j + 1] = '.'; ans[i + 1][j + 1] = '.'; ans[i + 2][j + 1] = '.'; ans[i + 2][j] = '.'; now += 4; } } } if (now != x && (x - now) % 8 == 0) { for (int j = 1; j < w; j += 4) { if (now < x) { ans[h - 3][j] = '#'; ans[h - 2][j + 1] = '.'; ans[h - 1][j + 2] = '#'; ans[h - 2][j + 3] = '.'; now += 4; } } } else if (now != x) { cout << -1 << endl; return 0; } if (!bo) { for (int i = 0; i < w; i++) { for (int j = 0; j < h; j++) { cout << ans[j][i]; } cout << endl; } } else { for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { cout << ans[i][j]; } cout << endl; } } return 0; } if ((h > w & !w == 3) || h == 3 || h % 4 == 3) { swap(h, w); bo = false; } if (h + w - 2 <= x && w * (h + 1) / 2 + h / 2 >= x) { if ((h + w - 2) % 4 == x % 4) { int now = h + w - 2; for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { if (j == 0 || i % 2 == 0) { ans[i][j] = '.'; } else { ans[i][j] = '#'; } } } for (int i = 0; i < h - 3; i += 4) { for (int j = 1; j < w; j += 2) { if (now < x) { ans[i + 1][j - 1] = '#'; ans[i][j] = '.'; ans[i][j + 1] = '.'; ans[i + 1][j + 1] = '.'; ans[i + 2][j + 1] = '.'; ans[i + 2][j] = '.'; now += 4; } } } if (!bo) { for (int i = 0; i < w; i++) { for (int j = 0; j < h; j++) { cout << ans[j][i]; } cout << endl; } } else { for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { cout << ans[i][j]; } cout << endl; } } } else { cout << -1 << endl; } } else { cout << -1 << endl; } }